SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Physical Computing 
with Ruby and Arduino 


       Matthew Williams 
         @mwilliams 
  Orlando Ruby Users Group
Barcamp Orlando Anyone?
What's Arduino? 




http://www.arduino.cc
Arduino haz Flavor?
http://rad.rubyforge.org/ 
  http://github.com/atduskgreg/rad/
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
Arduino IDE
RAD IDE
Ruby + Physical Computing 
•Control an Arduino with Ruby 
  •RubyToC 
  •AVR­GCC 
•Most of the Arduino API ported to 
Ruby 
•Additional libraries 
  •Serial communications 
  •Servos
Arduino Code 
int ledPin = 13; 
void setup() { 
  pinMode(ledPin, OUTPUT); 
} 
void loop() { 
  digitalWrite(ledPin, HIGH); 
  delay(1000); 
  digitalWrite(ledPin, LOW); 
  delay(1000); 
}
RAD Code 
class HelloWorld < 
ArduinoSketch 
 output_pin 7, :as => :led 
 def loop 
  blink led, 1000 
 end 
end
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
Coming Soon 
•Testing 
•Arduino Simulator 
•Better RubyToC Support 
•More quot;Out of the Box Supportquot; 
  •LCD's 
  •OLED Displays 
  •Motors
Arduino Shields 




http://www.nycresistor.com/2008/04/21/zach­ 
        smith­demos­his­danger­shield/
http://www.liquidware.com/projects/8/Pin+Visualizer
Buy an Arduino 

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


     $34.95 
     (or cheaper)
Awesome Resources 
•http://makezine.com/getstartedarduino/ 
•http://blog.makezine.com/archive/arduino/ 
•http://arduino.cc/playground
Barduino 


http://github.com/mwilliams/barduino
The Barduino 
•Arduino 
•Breadboard + Wire 
•Transistors 
•Relays 
•Windshield Washer Fluid Pumps 
•~$60 Total? 
•2 pumps, could handle 14+
Barduino­tender 



http://github.com/mwilliams/barduino­tender
Barduino­tender Recipe 
drink 'Screwdriver' do 
 serve_in 'Highball Glass' 
 ingredients do 
   2.ounces :vodka 
   5.ounces :orange_juice 
 end 
end
Want More? 
•RubyConf 2008 
  •Friday 
  •10:25 ­ 11:05 
  •Room 3 
•Greg Borenstein 
  •(Big help with this demo)
Let's Serve Some Drinks 
   (and look at code)

Weitere ähnliche Inhalte

Ähnlich wie Physical Computing with Ruby and Arduino

Intro to arduino
Intro to arduinoIntro to arduino
Intro to arduino
José Faria
 

Ähnlich wie Physical Computing with Ruby and Arduino (20)

arduino
arduinoarduino
arduino
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 
Extending The My Sql Data Landscape
Extending The My Sql Data LandscapeExtending The My Sql Data Landscape
Extending The My Sql Data Landscape
 
Johnny-Five
Johnny-FiveJohnny-Five
Johnny-Five
 
Let's begin io t with $10
Let's begin io t with $10Let's begin io t with $10
Let's begin io t with $10
 
How to build Open Hardware self-navigating car robot
How to build Open Hardware self-navigating car robotHow to build Open Hardware self-navigating car robot
How to build Open Hardware self-navigating car robot
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Arduino overview - introducing
Arduino overview - introducingArduino overview - introducing
Arduino overview - introducing
 
Javascript on Arduino
Javascript on ArduinoJavascript on Arduino
Javascript on Arduino
 
Arduino1.0 RC
Arduino1.0 RCArduino1.0 RC
Arduino1.0 RC
 
Intro to arduino
Intro to arduinoIntro to arduino
Intro to arduino
 
Functional IoT: Hardware and Platform
Functional IoT: Hardware and PlatformFunctional IoT: Hardware and Platform
Functional IoT: Hardware and Platform
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
Kicad 101
Kicad 101Kicad 101
Kicad 101
 
Smartphone++
Smartphone++Smartphone++
Smartphone++
 
Implementing a production Shibboleth IdP service at Cardiff University
Implementing a production Shibboleth IdP service at Cardiff UniversityImplementing a production Shibboleth IdP service at Cardiff University
Implementing a production Shibboleth IdP service at Cardiff University
 
Using arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsUsing arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of things
 
IoT Session Thomas More
IoT Session Thomas MoreIoT Session Thomas More
IoT Session Thomas More
 
Cc internet of things @ Thomas More
Cc internet of things @ Thomas MoreCc internet of things @ Thomas More
Cc internet of things @ Thomas More
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Physical Computing with Ruby and Arduino