Close

Choose between LED bar or LED dice with a GPIO

A project log for mail2code

Mail your code to my microcontroller and see what happens via webcam. One hardware setup for many students, availability: Worldwide 24/7

norbert-heinzNorbert Heinz 05/06/2023 at 18:380 Comments

Besides the 7 LEDs arranged in a dice pattern, I have added another 8 LEDs arranged in a line:

The LED bar is good for teaching port programming, bit manipulation or the binary number system. The LEDs in dice pattern on the other hand are good for teaching GPIO assignment, arrays or random numbers.

The 7 red LEDs and the 8 green LEDs both make use of the digital pins 0 -7. To choose what LEDs to illuminate, you can switch digital pin 8 to either LOW (red LEDs) or HIGH (green LEDs).

For safety reasons I have added serial 1.5k resistors to the input pins of the light sensors and the magnetic potentiometer. That makes sure the Arduino doesn't emit magic blue smoke in the event these pins are switched to output and set to HIGH afterwards.

There is currently one GPIO left without peripherals connected. It is pin A0, capable of analog signal reading. Feel free to leave a comment if you have an idea of what sensor to connect to that pin.

Discussions