Download - Physical Computing with the Arduino platform and Ruby

Transcript
Page 1: Physical Computing with the Arduino platform and Ruby

Physical Computing with Ruby and Arduino

Matthew Williams@mwilliams

Orlando Linux Users Group

Page 2: Physical Computing with the Arduino platform and Ruby

Barcamp Orlando Anyone?

Page 3: Physical Computing with the Arduino platform and Ruby

What's Arduino?

http://www.arduino.cc

Page 4: Physical Computing with the Arduino platform and Ruby
Page 5: Physical Computing with the Arduino platform and Ruby

Arduino•14 Digital I/O (6 PWM)•6 Analog In•16kb Flash Memory

•2kb for boot loader•16MHz Clock Speed•Serial Communication•USB Powered (or AC)•I2C

Page 6: Physical Computing with the Arduino platform and Ruby

Arduino haz Flavor?

Page 7: Physical Computing with the Arduino platform and Ruby
Page 8: Physical Computing with the Arduino platform and Ruby
Page 9: Physical Computing with the Arduino platform and Ruby
Page 10: Physical Computing with the Arduino platform and Ruby
Page 11: Physical Computing with the Arduino platform and Ruby
Page 12: Physical Computing with the Arduino platform and Ruby

http://rad.rubyforge.org/

http://github.com/atduskgreg/rad/

Page 13: Physical Computing with the Arduino platform and Ruby

Arduino IDE

Page 14: Physical Computing with the Arduino platform and Ruby

RAD IDE

Page 15: Physical Computing with the Arduino platform and Ruby

Ruby + Physical Computing

•Control an Arduino with Ruby•RubyToC•AVR-GCC

•Most of the Arduino API ported to Ruby•Additional libraries

•Serial communications•Servos

Page 16: Physical Computing with the Arduino platform and Ruby

Arduino Codeint ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); }

Page 17: Physical Computing with the Arduino platform and Ruby

RAD Codeclass HelloWorld < ArduinoSketch output_pin 7, :as => :led def loop blink led, 1000 end end

Page 18: Physical Computing with the Arduino platform and Ruby

RAD Methods•input_pin(s)•output_pin(s)•digitalWrite| digitalRead•analogWrite | analogRead•serial_print | serial_read•Keeping it simple

•It's all about the hardware

Page 19: Physical Computing with the Arduino platform and Ruby

Coming Soon•Testing•Arduino Simulator•Better RubyToC Support•More "Out of the Box Support"

•LCD's•OLED Displays•Motors

Page 20: Physical Computing with the Arduino platform and Ruby

Arduino Shields

http://www.nycresistor.com/2008/04/21/zach-smith-demos-his-danger-shield/

Page 21: Physical Computing with the Arduino platform and Ruby
Page 22: Physical Computing with the Arduino platform and Ruby
Page 23: Physical Computing with the Arduino platform and Ruby
Page 24: Physical Computing with the Arduino platform and Ruby

http://www.liquidware.com/projects/8/Pin+Visualizer

Page 25: Physical Computing with the Arduino platform and Ruby

Buy an Arduino

http://www.sparkfun.comhttp://ww.makezine.com

$34.95(or cheaper)

Page 26: Physical Computing with the Arduino platform and Ruby

Awesome Resources•http://makezine.com/getstartedarduino/•http://blog.makezine.com/archive/arduino/•http://arduino.cc/playground

Page 27: Physical Computing with the Arduino platform and Ruby

Barduino

http://github.com/mwilliams/barduino

Page 28: Physical Computing with the Arduino platform and Ruby

The Barduino•Arduino•Breadboard + Wire•Transistors•Relays•Windshield Washer Fluid Pumps•~$60 Total?•2 pumps, could handle 14+

Page 29: Physical Computing with the Arduino platform and Ruby

Barduino-tender

http://github.com/mwilliams/barduino-tender

Page 30: Physical Computing with the Arduino platform and Ruby

Barduino-tender Recipedrink 'Screwdriver' do serve_in 'Highball Glass' ingredients do 2.ounces :vodka 5.ounces :orange_juice end end

Page 31: Physical Computing with the Arduino platform and Ruby

Let's Serve Some Drinks(and look at code)