top of page
Search

Matthew's Creative Coding Blog: Variables, Conditionals, and Circuits

  • mziegen
  • Sep 20, 2021
  • 2 min read

In this week's project, I have involved one button press and two LED lights on my breadboard, connected to a micro:bit, installed into pin:bit, to read the message, "Merry Christmas", as the A button allows one to switch between the red and green LED light colors which gives it a more festive look considering those two colors are the colors of Christmas.


First I had to create a code to install into the micro:bit. The following photos show my steps in the process:


1. "Merry Christmas" will display on micro:bit


2. This step allows for our light to be switched on and off. This will transition between the red and green light.


3. This last step to the coding creates an outlet for how we can switch our light. So since it is installed into our button A press, pressing button A will let us switch between the lights.

4. This is now our code. Once downloaded, you can plug your usb into the computer, and the other end into the micro:bit so that all the materials used can work together to display the message and gives use to our buttons.


Since our code calls for pin 1 and pin 14 of our pin:bit to be plugged, this is where our lights and the first pin in our resistors will be implanted. After lining the first pin of our resistors up with the row the light is in, we plug in of our wire from ground (on the pin:bit) to line up with the other end of either of the resistors. This gives power to our micro:bit and, ultimately, the breadboard.


Finally, the code has been installed and our board is set up, the micro:bit will perform to its standard.








To access the code to this project, visit the link that follows:






 
 
 

Recent Posts

See All
Matthew's Coding Blog: Final

Unfortunately, I am mere inches away from finishing the product. This month has set my life into what feels like an irreversible...

 
 
 

Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2021 by Matthew's Blog. Proudly created with Wix.com

bottom of page