More Simple Arduino Projects

I was able to pick up a breadboard today and some wires for it so tonight I've put together some more complicated (though still very simple) circuits and programs to continue learning the Arduino. The night before last I wrote a simple Arduino program and an accompanying Java UI so that I could dim or brighten an LED by adjusting the value of a scroll bar. This was fun for 5 minutes. Today I extended it a little by adding 3 LEDs and in addition to adjusting the brightness, configured the LEDs to be on or off depending on the value of the last 3 bits of the scroll bar value (from 0 to 255).
Next I want to get away from serial comms and move into more standalone circuits so rather than reading values over the serial connection and setting the LEDs, I hooked up a switch and added a stored value on the Arduino such that when the switch goes from off to on the value is incremented then the associated bits are displayed by the LED. This makes a sort of counter so you can count the number of times the switch has been flipped by checking which LEDs are on. So if the set of LEDs are {0,0,0} (all off) then flipping the switch on makes them {0,0,1}. Flip it off and on again they become {0,1,0}, then {0,1,1} and so forth. Extremely basic stuff but there's not much use in rushing into things since I haven't studied circuits since before I moved here a year ago. I've got a DC motor and a transistor. Maybe next I'll try to get that working.


0 Comments:
Post a Comment
<< Home