Electronics Electronics Design Electronics Production Electronics Programming Micro:bit XE Week 5 - electronics design XE Week 6 - embedded programming

Electronics Design – The Tasks

With knowledge of Micro:bits and how they’re programmed (detailed in previous post) we were tasked with experimenting with reproducing circuits that we’d previously made but using the Micro:bit.

In my first electronics post I made a simple circuit where a button was pressed, an LED illuminated and capacitor made the LED dim slowly. I recreated this using the Micro:bit programming and hardware rather than external hardware – this meant that with no capacitor the slow dim of the LED needed to be programmed using delays.

This is the result, a simulations and the code is below:

 

 

 

Next I tried something that required external components connected to the Micro:bit

I made a circuit that used a light dependant resistor (LDR) as an input and programmed the Micro:bit to displays the reading.

LDR circuit

 

To make connecting the LDR and resistor easier I used a breakout board. It had some messy soldering but it worked:

LDR microbit

 

This is the remarkably simple code to make it work:

LDR circuit program

Essentially, when button A is pressed display the reading from pin P0 which is where the LDR is connected, simple. Here are the results:

 

 

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by: Wordpress
Skip to toolbar