Friday, July 2, 2010

Arduino Digital Display: Count up and Serial Control

My Arduino is currently hooked up to a digital display. This is an electrical component that has LEDs arranged so that you can display a number. To display something, you turn on each LED individually in whatever configuration you like. Right now I have the Arduino hooked up to the digital display with a solderless breadboard. One output pin is connected to each LED of the display. Here is a sketch (Arduino program) to display numbers counting up from 0 to 9 (this repeats, as all Arduino sketches do).

Digital Display: Counting Up

This is a sketch that displays numbers that are sent to it from the computer. This is done through USB, but the Arduino and the computer pretend it's an old school serial hookup. You control what's sent through the serial monitor that comes with the Arduino software.

Digital Display: Computer control

I experimented with making my own functions in C with these projects. Instead of manually turning on and off the specific LEDs needed, I made a function that takes in an input number and manipulates the correct LEDs to display that number.

In the future I plan to make a library of the functions I use for the digital display. This allows one to easily include functions into a program without having to manually define them in a big long mess in the beginning.

No comments:

Post a Comment