Theory
📟⚙️ 9. Display: Making primary colors of light
🎨 Explore RGB LEDs to make colourful lights with micro: bit.
- 🌈 Learn to mix primary colors of light – red, green, and blue.
- 🔴🟢🔵 Use code to control individual colors on the LED.
- 🔘 Start a new project on makecode.microbit.org.
- 📌 Name it ‘Making Primary Colors’.
- 🔆 Understand the connection between pins and LED colors.
- 🟢 Use ‘digital write pin’ commands to control LED colors.
- 🔴 Follow instructions to turn on specific colors with button A.
- 🔵 Learn to toggle between different primary colors.
- 🔘 Get hands-on experience with coding and electronics.
🟩 Button A pressed ➡️ Power to green light:
- 🚫 No power to red light or blue light
- 💚 Light shows up as green
- 🔁 Duplicate ‘on button A pressed’ command
- 🔄 Change to ‘on button B pressed’
- 🔄 Change command for B button press to activate red light (P1) instead of green light (P0)
- 🔢 Change number in ‘digital write pin P0’ to 0.
- 🔢 Change number in ‘digital write pin P1’ to 1.
- 🔵 Set A+B button press to activate blue light (P2)
- 💻 Duplicate ‘on button B’ pressed command.
- ✏️ Change ‘A’ to ‘A+B’
- 🔢 Change number in ‘digital write pin P1’ to 0.
- 🔢 Change number in ‘digital write pin P2’ to 1.
- 📥 Download project
📲 Copy to Microbit
🔌 Connect circuit
🅰️ Press A - 🅱️ Press B
🅰️+🅱️ Press A+B
🎨 Check for three colors
🛠️ Watch troubleshooting video
🔍 Identify circuit issues
🔧 Fix circuit