Posts Tagged ‘LED’

A simple Arduino Task Scheduler (video)

I uploaded a new video to demonstrate the task scheduler in action. In this example I am driving two servo motors, two LEDs and a print-out to the serial port.

You will find more details on how to use the task scheduler on my previous post. The code is available for download from my Github account at: https://github.com/pchretien/scheduler

Arduino LED Matrix – Video

A short video to show the Arduino LED Matrix project in action.

LED Matrix and Arduino

Light Emitting Diodes (LED) are everywhere. There is a good reason for that, we love them! Most of us are using LEDs to communicate information, debug our code or simply add some style to our electronic projects. One of the first things one normally want to do is pack a bunch of LED to create a mini display. Lets see how we can build a simple 3×3 LED matrix display in less than an hour.

LED Matrix Driven by an Arduino

LED Matrix Driven by an Arduino

To build this simple circuit all you have to do is solder the cathodes (longer pin) of each column together and the anodes (shorter pin) of each row together. To avoid shorts between anodes and cathodes I added a layer of cardboard before to bend the anodes over the cathodes. Here is the schematics for this circuit:

LED Matrix Circuit

LED Matrix Circuit

Once the circuit is finished you connect the cathodes (k) to pins 2, 3 and 4 and the anodes (a) to pins 5, 6 and 7 of the Arduino board. You are done with the hardware. Lets make the program …

The following program will display a few different patterns on the LED matrix. The code is ugly and I don’t really care. We are not here to talk about code re-use but to play with LED!

You can find the code on my Github at:
https://github.com/pchretien/flash_leds

To match the code and the circuit displayed here, connect K3 with pin #5 and A3 with pin #2. I guess you will figure out how to connect the remaining LED wires!

Driving only 9 LEDs using 6 wires is far from efficient. To find out how to drive more LEDs using only 3 pins on your Arduino and an 75HC595 register chip , visit the Arduino Playground website at:
http://www.arduino.cc/en/Tutorial/ShiftOut

Have fun …