## Prereq ### Arduino What is [Arduino](http://arduino.cc/en/)? > Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Build "sketches" (combo of C/C++) in a Java based IDE and upload to Arduino via serial port. /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } ### Firmata What is [firmata](http://firmata.org/wiki/Main_Page)? > Firmata is a generic protocol for communicating with microcontrollers from software on a host computer. It is intended to work with any host computer software package. This firmata protocol uses the MIDI message format, but does not use the whole protocol. ## Shout outs * [Rick Waldron](https://github.com/rwldrn) for [johnny-five](https://github.com/rwldrn/johnny-five) and his [NodeConf presentation](http://2012.nodeconf.com/theatre/rick_waldron.html) * [Chris Williams](https://github.com/voodootikigod) for his [NodeBots - The Rise of JS Robotics](http://www.voodootikigod.com/nodebots-the-rise-of-js-robotics) post * [Emily Rose](https://github.com/nexxy) for her [Security system NodeConf 2012 presentation]( https://docs.google.com/presentation/d/1m1MiyNffoqeYQMLrtqnY990kJdfaPKhtyEXh5MQ6rC0/edit#slide=id.g14c70e36_0_0) * [jgautier](https://github.com/jgautier) for his [firmata](https://github.com/jgautier/firmata) implementation in JS * [NodeUp 27 - a robotics deep dive show](http://nodeup.com/twentyseven) ## Current Ruby Options * [ruFirmata](https://github.com/PlasticLizard/rufirmata) Port of pyFirmata. No longer active. * [rad](https://github.com/atduskgreg/rad/) A full IDE aimed at replacing the Arduino IDE. * [arduino](https://github.com/HashNuke/arduino) Requires custom sketch. Implement own command wrappers. * [ruby-firmata](https://github.com/patcoll/ruby-firmata) Not fully implemented or currently active. ## Hacking * [firmata](https://github.com/hardbap/firmata) [LED blink](https://github.com/hardbap/firmata/blob/master/examples/blink_led.rb) with firmata * [wall-e](https://github.com/hardbap/wall_e) [LED blink](https://github.com/hardbap/wall_e/blob/master/cookbook/Led/blink.rb) with wall-e The wall_e prompt (built on [Pry](https://github.com/pry/pry)) What about [EventMachine](https://github.com/eventmachine/eventmachine)? ## Demos * [LED](https://github.com/hardbap/wall_e/blob/master/cookbook/Led) [pulse](https://github.com/hardbap/wall_e/blob/master/cookbook/Led/pulse.rb) * [Piezo](https://github.com/hardbap/wall_e/blob/master/cookbook/Piezo) [morse code](https://github.com/hardbap/wall_e/blob/master/cookbook/Piezo/morse_code.rb) * [Servo](https://github.com/hardbap/wall_e/blob/master/cookbook/Servo) [sweep](https://github.com/hardbap/wall_e/blob/master/cookbook/Servo/sweep.rb) ## Fun stuff * claw with Websockets ## Short term goals... * enhance cookbook with vids, [Fritzing](http://fritzing.org/) schematics, parts lists * implement pulseIn in firmata so we can [Ping)))](https://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/92/Default.aspx?txtSearch=ping) * components, components, components ## Reference * [Arduino bit math tutorial](http://www.arduino.cc/playground/Code/BitMath) * [Manga Guide to Electricity](http://nostarch.com/mg_electricity.htm)