I’ve been playing with microcontrollers for over a decade now, and have hands-on experience with PIC, ARM, 68HC11, and MSP430 devices. Usually, it’s a long slow road where you (1) pick a processor to buy, (2) pick a device programmer, (3) pick a compiler, (4) read the processor documentation, (5) find/fix example code until it compiles, (6) program the chip, (7) figure out why the lights aren’t blinking. It’s usually very painful, takes a few days at the very least, and every new task or chip is just more work.
But this is easy!
- Buy an Arduino Uno R3 for about $30. Lots of places have the hardware, including Amazon (and cable) or SparkFun (and cable). The cable is an ordinary USB A to B cable, with the thick square end like on most USB printers.
- Download and unzip the Arduino 1.0 IDE. (On Linux, you’ll also need to “sudo apt-get install gcc-avr avr-libc” to get the compiler.)
- Open the IDE’s “Drivers” folder. Right click “Arduino UNO R3.inf” and hit “Install”. Plug in the Arduino, and it should show up as a serial port (something like COM3 or /dev/ttyUSB0.)
- The very similar Arduino Duemilanove 2009 board doesn’t need drivers; it shows up as an ordinary FTDI USB to serial device.
- Start up the IDE by double clicking Arduino.exe, and:
- Choose File -> Examples -> Firmata -> StandardFirmata.
- Hit File -> Upload. The TX and RX LEDs will flicker as the device is programmed.
- The Arduino now responds to the serial Firmata command protocol.
- Download the Firmata Test Program, run it, and choose the “Port” from the menu (like COM3 or ttyUSB0.)
- Click pin 13 on and off, and watch the LED blink! You can set any pin to input (reading low or high voltage) or output (producing low or high voltage), and many pins have other functions available like analog input, PWM(pulse width modulation), or servo control. Just click and drag to interact with all the pins!
The beautiful thing about this is you don’t have to figure out how to enable analog inputs, initiate ADC conversions, correctly set the PWM control registers, or set interrupt modes–it’s pure plug and play!