10: Color Picker

This project lets buttons choose which LED color turns on.

This is your first “inputs + outputs” code project. The buttons are inputs your code reads, and the LEDs are outputs your code controls.

Coding ideas you will use (once the code is added):

Learn more (optional):

Goal

Press one button to turn on one color and another button to turn on a different color.

Parts you need

Important: choose the right resistor

Your kit has 150Ω and 100Ω resistors.

  • For a red or yellow LED, use 150Ω
  • For a green, blue, or white LED, use 100Ω

Using the wrong resistor can damage an LED.

Wiring idea

Build it first, then compare your setup to the diagram. Did you connect each part to the pin you meant to use?

Suggested setup:

For the buttons, use one side to connect to GND and let the code use pull-up resistors.

Wiring diagram showing two LEDs as outputs and two pushbuttons as inputs to the RP2040-Zero

Code

Pin reminder

If you wire different pins than the suggested setup, make sure the GPIO numbers in your code match your wiring.

// placeholder

What to notice

Challenge

Change the colors or make both LEDs turn on when both buttons are pressed.