Arduino
After seeing lots of cool Arduino based projects on Engadget and Gizmodo, I decided to get one myself to get into hardware programming. I bought this off sgbotic.com. The kit cost $136.90.
The best thing about the Arduino is its straightforward development environment. The Java based IDE, is very clean and simple, totally idiot proof. There is only one row of buttons on top, compile, stop, new file, open file, save file, upload to Arduino and serial monitor. The language used is actually C/C++. Arduino's standard library is very useful and easy to use.
After going through some of the tutorial exercises in the booklet that was bundled in the package, I felt confident enough to start building something rudimentary but original. I ended up building a row of LED controlled by 2 buttons. Although there's enough digital pins on Arduino for 8 LED's, I thought it would be more challenging to use a shift register to control 8 LED by using just 3 input pins on Arduino.
Just 3 pins to...
8 pins! The shift register is kinda like a demultiplexer. It receives serial data and converts it into parallel outputs which drives these LEDs.
Each of these LEDs are connected to one of the output leg of the 74hc595 shift register. So for example if the shift register receives a binary byte 10101010 (which is equivalent to 170 decimal), the first, third, fifth and so on... LED will light up. Anyway, to light up individual LED means some calculation is required, not as straightforward as turning it on directly from Arduino. So turning on the 4th LED from the left means 0001000 (16 decimal) have be sent to the shift register and turning on the 3rd means 00100000 (32 decimal) needs to be sent to the shift register. See a pattern? So to switch on the left LED and switch off the right LED just have to x2.








