Attaching an LED
Materials: LED and 2 Aligator Clips
Last updated
Materials: LED and 2 Aligator Clips
Last updated
These diodes light up when a current is passed through. They have only two states ON or OFF.
In all of computer science the following idea / statements will be true
Examine your diode: our LED's come in 4 options: red, yellow, blue, green or clear/white. They have two legs - one is longer than the other
Disconnect your microbit from the computer or batteries (aka take away all power while be play with electricity)
Attach your ground wire to the GRD Pin on your microbit
Attach the other end to the short leg of your LED
Attach the 2nd clip to PIN 0
Attach the other end of your 2nd clip to the long leg of your led
Here is the code for the microbit. LED's can be "finicky" so this is a good time to have an image appear on start - this debugging technique will ensure that your program was loaded properly.
Now download and test your code. When you press the A button your LED should light up. Sometimes the codes need to be slightly adjusted so if it does not immediately light up, spend some time double checking your clip connections and wires. This can take a bit of patience.
Now return to your code and modify it so that when Button A is pressed
the LED light turns off.