SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
Hardware Hacking en
Ruby: Arduino y RAD
    Esti Álvarez y Svet Ivantchev
        http://www.efaber.net
       Conferencia Rails 2008
Sistemas integrados
Physical Computing
¿Qué es Arduino?




  http://www.arduino.cc
¿Por qué Arduino?

• Es Open Source
• Es multiplataforma (Linux, Mac, Windows)
• Se puede programar con cable USB
• Pensado para hacer prototipos
• El hardware es barato (30€)
La familia Arduino
El Hardware
El Hardware
• 14 pins IO digitales
• 6 pins Input analógicos
• 6 pins Output analógicos (PWM)
• 16Kb memoria Flash (Apollo 11: 74 Kb)
• 1Kbyte RAM (Apollo 11: 4Kb)
• Microcontrolador ATMega168 a 16MHz
• Alimentación por USB o pila de 9V
Otras piezas

• Sensores “binarios”: interruptores,
  termostatos, switches magnéticos, de
  posición, de luz, etc
• Sensores “analógicos”: termistores,
  accelerómetros.
• “Actuadores”: leds, motores, servos, LCDs
El Software




http://arduino.cc/en/Main/Software
Hello World: Hardware


             Pin 13
   Arduino
Hello World: Software
/* Blink
 * The basic Arduino example.Turns on an LED on for one second,
 * http://www.arduino.cc/en/Tutorial/Blink */

int ledPin = 13;             // LED connected to digital pin 13

void setup() {               // run once, when sketch starts
  pinMode(ledPin, OUTPUT);   // sets the digital pin as output
}

void loop() {                // run over and over again
  digitalWrite(ledPin, HIGH);// sets the LED on
  delay(1000);               // waits for a second
  digitalWrite(ledPin, LOW); // sets the LED off
  delay(1000);               // waits for a second
}
Demo
Demo
Difuminado RGB: Hardware

               pin 9

               pin 10
     Arduino
               pin 11

               PWM
PWM
/* Code for cross-fading 3 LEDs, RGB, or one tri-color LED */
int redPin = 9;    int greenPin = 10; int bluePin = 11;
int redVal = 255; int greenVal = 1; int blueVal = 1;
int i = 0;      // Loop counter

void setup() {
  pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {
  i += 1;      // Increment counter
  if (i < 255) {
    redVal   -= 1; greenVal += 1; blueVal   = 1;
  } else if (i < 509) {
    redVal    = 1; greenVal -= 1; blueVal += 1;
  } else if (i < 763) {
    redVal += 1; greenVal = 1; blueVal -= 1;
  } else {
    i = 1;
  }
  analogWrite(redPin,   redVal); analogWrite(greenPin, greenVal);
  analogWrite(bluePin, blueVal);
  delay(10); // Pause for 10 milliseconds before resuming the loop
}
RAD: Ruby Arduino
     Development
• Añadir a Arduino las ventajas de programar
  en Ruby
• Convenciones y helpers inspirados en Rails
• Testing Framework aprovechando el
  dinamismo de Ruby
• Entorno de simulación gráfica usando “Shoes
  GUI”
RAD: Ruby Arduino
    Development
$ sudo gem install rad
$ rad hello_world
Successfully created your sketch directory.
...
Added   hello_world/hello_world2.rb
Added   hello_world/Rakefile
Added   hello_world/config
Added   hello_world/config/hardware.yml
Added   hello_world/config/software.yml
RAD: Ruby Arduino
     Development
$ ls -l hello_world
-rw-r--r--   1 esti     esti    31 Rakefile
drwxr-xr-x     4 esti   esti    136 config
drwxr-xr-x    42 esti   esti   1428 examples
drwxr-xr-x    7 esti    esti   238 hello_world
-rw-r--r--@   1 esti    esti   106 hello_world.rb
drwxr-xr-x    5 esti    esti   170 vendor
Hello World
class HelloWorld < ArduinoSketch

  output_pin 7, :as => :led

  def loop
    led.blink 500
  end

end
Compilar y transferir


$ rake make:upload
Demo
Twitter Lámpara
Twitter Lámpara
Twitter Lámpara
Twitter Lámpara
Twitter Lámpara
TwitAmbiLight

• Comunicación por puerto serie
• Datos del REST API de Twitter
• Los colores de nuestra lámpara dependerán
  del humor de nuestros followers en Twitter.
TwitAmbiLight: Ingredientes
 • 1 Arduino y 1 breadboard
 • 1 LED RGB y 3 resistencias de 220 ohms
 • 1 Cable USB y unos cuantos de conexión
   $ gem install toholio-serialport
   $ gem install twitter
   $ gem install mbbx6spp-twitter4r
TwitAmbiLight: Hardware
TwitAmbiLight: Hardware
                                       +5 V   +5 V   +5 V




                              pin 11
   USB
                              pin 10
         Arduino
                              pin 9

                              PWM




                   Internet
TwitterAmbiLight: Software Ordenador
 # Se conecta al API de Twitter y busca colores en formato RGB
 # Hexadecimal entre los replies a @raduino
 # Ejemplo: @raduino #FF0000

 %w(rubygems twitter serialport).each {|g| require g}
 gem 'mbbx6spp-twitter4r'

 # params para puerto serie
 port_str = quot;/dev/tty.usbserial-A4001lmtquot; # puede cambiar para ti
 baud_rate = 9600
 data_bits = 8
 stop_bits = 1
 parity = SerialPort::NONE
 sp = SerialPort.new(port_str, baud_rate, data_bits, stop_bits,
 parity)

 ...
def get_color_from_twitter
  client = Twitter::Client.new(:login => 'raduino',
                               :password => 'mypass')
  last_status = client.status(:replies).first
  color = last_status.text.gsub('@raduino', '').strip || ''
end

5.times do
  puts quot;Cojo el colorquot;
  color = get_color_from_twitter
  puts quot;Devuelve #{color}quot;
  if color.match(/#[A-F0-9]{6}$/i)
    puts quot;Envio en color al puerto seriequot;
    sp.write color
  end
  puts quot;-------------quot;
  sleep(10)
end
sp.close
TwitterAmbiLight: Software Arduino
class TwitAmbiLight < ArduinoSketch
  output_pin 9, :as => :red_led
  output_pin 10, :as => :green_led
  output_pin 11, :as => :blue_led

 r = 255; g = 255; b = 255

 @first_byte = byte;
 @byte1 = byte; @byte2 = byte; @byte3 = byte
 @byte4 = byte; @byte5 = byte; @byte6 = byte

 serial_begin
 def setup
   red_led.digitalWrite HIGH
   green_led.digitalWrite HIGH
   blue_led.digitalWrite HIGH
 end
 ...
...
def loop
  if serial_available
    # Si el primer byte es #, leer los 6 siguientes
    @first_byte = serial_read
    if @first_byte == '#'
      @byte1=serial_read; serial_print quot;Primer caracter:quot;;serial_println @byte1
      @byte2 = serial_read; serial_print quot;2 caracter:quot;; serial_println @byte2
      @byte3 = serial_read; serial_print quot;3 caracter:quot;; serial_println @byte3
      @byte4 = serial_read; serial_print quot;4 caracter:quot;; serial_println @byte4
      @byte5 = serial_read; serial_print quot;5 caracter:quot;; serial_println @byte5
      @byte6 = serial_read; serial_print quot;6 caracter:quot;; serial_println @byte6

      r = 255 - h2d(@byte1)   * 16 + h2d(@byte2)
      g = 255 - h2d(@byte3)   * 16 + h2d(@byte4)
      b = 255 - h2d(@byte5)   * 16 + h2d(@byte6)
    end
    serial_print quot;Rojo: quot;;    serial_println r
    serial_print quot;Verde: quot;;   serial_println g
    serial_print quot;Azul:quot;;     serial_println b
    red_led.analogWrite(r);   green_led.analogWrite(g); blue_led.analogWrite(b)
    delay(100)
  end
end
...
...

 def h2d(c)
   if c >= 48 && c <= 57
     # c esta entre 0 y 9
     return c - '0'
   elsif c >= 'A' && c <= 'F'
     # c esta entre A y F
     return c - 65 + 10
   end
 end

end
Demo
Opciones Wireless
                   Zigbee
                                 GSM/GPRS             802. 11          Bluetooth
                  802.15.4
                Moritorizado y                                         Conectividad
 Aplicación                       Voz y datos      Internet rápido
                   control                                           entre dispositivos

  Duración        ~ semanas          ~ días           ~ horas             ~ horas
   batería

  Ancho de
                  250 kbps       Hasta 2 Mbps      Hasta 54 Mbps         720 kbps
   banda

Alcance típico 100-1000 metros    Kilómetros       150-300 metros     10-100 metros


                                 Infraestructura
   Ventajas     Bajo consumo                         Velocidad         Comodidad
                                    existente
XBee   XBee Arduino Shield
WiTwitAmbiLight: Hardware
                                                             +5 V   +5 V   +5 V




                                                    pin 11
                serie
     Xbee                                           pin 10
                               Arduino
                                                     pin 9




                    802.15.4




     Xbee

            serie



                                         Internet
Demo
Nunchuck como sensor

           •   Interfaz I2C standard

           •   Accelerómetro de 3 ejes

           •   Joystick analógico de 2 ejes

           •   2 botones
Ejemplo Nunchuck
                                          +5 V




                            pin 11
       serie
Xbee                        pin 10
                  Arduino
                            pin 9
                            PWM




       802.15.4




                                    i2c
       serie
Xbee              Arduino
Demo
Referencias

• Getting Started with Arduino. Make Magazine
• http://www.arduino.cc/
• http://rad.rubyforge.org/
• http://github.com/atduskgreg/rad/tree/master
• http://todbot.com/blog/bionicarduino/
Algunos ejemplos

• http://www.cs.colorado.edu/~buechley/LilyPad/
  build/turn_signal_jacket.html
• http://vimeo.com/1261369
• http://vimeo.com/1650051
• http://www.botanicalls.com/kits/

Más contenido relacionado

La actualidad más candente

Frecuencimetro receptor hall esquema y programa pbp 28 pag
Frecuencimetro receptor hall esquema y programa pbp 28 pagFrecuencimetro receptor hall esquema y programa pbp 28 pag
Frecuencimetro receptor hall esquema y programa pbp 28 pagjoaquinin1
 
Manual de operación arduino cabezal
Manual de operación arduino cabezalManual de operación arduino cabezal
Manual de operación arduino cabezalXxScioNxX
 
Taller de introducción a Arduino OSL 2014
Taller de introducción a Arduino OSL 2014Taller de introducción a Arduino OSL 2014
Taller de introducción a Arduino OSL 2014Jose Antonio Vacas
 
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017joaquinin1
 
Arduino aplicado a la maqueta digital
Arduino aplicado a la maqueta digitalArduino aplicado a la maqueta digital
Arduino aplicado a la maqueta digitalDaniel Guisado
 
Workshop iniciacion arduino d2
Workshop iniciacion arduino d2Workshop iniciacion arduino d2
Workshop iniciacion arduino d2José Pujol Pérez
 
Proyecto robot mentor v1 enero_19_por_joaquin berrocal piris
Proyecto robot mentor v1 enero_19_por_joaquin berrocal pirisProyecto robot mentor v1 enero_19_por_joaquin berrocal piris
Proyecto robot mentor v1 enero_19_por_joaquin berrocal pirisjoaquinin1
 
S4 a + arduino
S4 a + arduinoS4 a + arduino
S4 a + arduinoVisemi VI
 
Introducción a Asterisk + IVR en AEL2
Introducción a Asterisk + IVR en AEL2Introducción a Asterisk + IVR en AEL2
Introducción a Asterisk + IVR en AEL2Saúl Ibarra Corretgé
 
Curso intensivo de arduino createc3 d marzo 2014
Curso intensivo de arduino createc3 d marzo 2014Curso intensivo de arduino createc3 d marzo 2014
Curso intensivo de arduino createc3 d marzo 2014Jose Antonio Vacas
 
Taller de introducción a Arduino FesTICval 2012
Taller de introducción a Arduino FesTICval 2012Taller de introducción a Arduino FesTICval 2012
Taller de introducción a Arduino FesTICval 2012assdl
 
Construccion seguidor de línea por joaquín berrocal verano 2017
Construccion seguidor de línea por joaquín berrocal verano 2017Construccion seguidor de línea por joaquín berrocal verano 2017
Construccion seguidor de línea por joaquín berrocal verano 2017joaquinin1
 
Presentacion Arduino PowerPoint
Presentacion Arduino PowerPointPresentacion Arduino PowerPoint
Presentacion Arduino PowerPointcristianperea
 
Curso de introducción a arduino
Curso de introducción a arduinoCurso de introducción a arduino
Curso de introducción a arduino3D Print Barcelona
 
Taller Internet de las Cosas, por Ulises Gascón
Taller Internet de las Cosas, por Ulises GascónTaller Internet de las Cosas, por Ulises Gascón
Taller Internet de las Cosas, por Ulises GascónHuelva Inteligente
 
Taller de Arduino - ¿Qué es Arduino?
Taller de Arduino - ¿Qué es Arduino?Taller de Arduino - ¿Qué es Arduino?
Taller de Arduino - ¿Qué es Arduino?mrquesito
 
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...Yamil Lambert
 

La actualidad más candente (20)

Frecuencimetro receptor hall esquema y programa pbp 28 pag
Frecuencimetro receptor hall esquema y programa pbp 28 pagFrecuencimetro receptor hall esquema y programa pbp 28 pag
Frecuencimetro receptor hall esquema y programa pbp 28 pag
 
Manual de operación arduino cabezal
Manual de operación arduino cabezalManual de operación arduino cabezal
Manual de operación arduino cabezal
 
Taller de introducción a Arduino OSL 2014
Taller de introducción a Arduino OSL 2014Taller de introducción a Arduino OSL 2014
Taller de introducción a Arduino OSL 2014
 
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017
Proyecto coche por bluetooth por joaquin berrocal piris marzo 2017
 
Arduino aplicado a la maqueta digital
Arduino aplicado a la maqueta digitalArduino aplicado a la maqueta digital
Arduino aplicado a la maqueta digital
 
Workshop iniciacion arduino d2
Workshop iniciacion arduino d2Workshop iniciacion arduino d2
Workshop iniciacion arduino d2
 
Proyecto robot mentor v1 enero_19_por_joaquin berrocal piris
Proyecto robot mentor v1 enero_19_por_joaquin berrocal pirisProyecto robot mentor v1 enero_19_por_joaquin berrocal piris
Proyecto robot mentor v1 enero_19_por_joaquin berrocal piris
 
S4 a + arduino
S4 a + arduinoS4 a + arduino
S4 a + arduino
 
Introducción a Asterisk + IVR en AEL2
Introducción a Asterisk + IVR en AEL2Introducción a Asterisk + IVR en AEL2
Introducción a Asterisk + IVR en AEL2
 
Curso intensivo de arduino createc3 d marzo 2014
Curso intensivo de arduino createc3 d marzo 2014Curso intensivo de arduino createc3 d marzo 2014
Curso intensivo de arduino createc3 d marzo 2014
 
Taller de introducción a Arduino FesTICval 2012
Taller de introducción a Arduino FesTICval 2012Taller de introducción a Arduino FesTICval 2012
Taller de introducción a Arduino FesTICval 2012
 
Construccion seguidor de línea por joaquín berrocal verano 2017
Construccion seguidor de línea por joaquín berrocal verano 2017Construccion seguidor de línea por joaquín berrocal verano 2017
Construccion seguidor de línea por joaquín berrocal verano 2017
 
Ethernet Shield
Ethernet ShieldEthernet Shield
Ethernet Shield
 
Presentacion Arduino PowerPoint
Presentacion Arduino PowerPointPresentacion Arduino PowerPoint
Presentacion Arduino PowerPoint
 
Curso de introducción a arduino
Curso de introducción a arduinoCurso de introducción a arduino
Curso de introducción a arduino
 
Intro al beaglebone black makerspe
Intro al beaglebone black   makerspeIntro al beaglebone black   makerspe
Intro al beaglebone black makerspe
 
Arduino práctico librerias
Arduino práctico   libreriasArduino práctico   librerias
Arduino práctico librerias
 
Taller Internet de las Cosas, por Ulises Gascón
Taller Internet de las Cosas, por Ulises GascónTaller Internet de las Cosas, por Ulises Gascón
Taller Internet de las Cosas, por Ulises Gascón
 
Taller de Arduino - ¿Qué es Arduino?
Taller de Arduino - ¿Qué es Arduino?Taller de Arduino - ¿Qué es Arduino?
Taller de Arduino - ¿Qué es Arduino?
 
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...
Arduino Historia, IDE, lenguaje de programacion y proyectos por Msc. Yamil La...
 

Similar a Hardware Hacking Rad

Robotica Educativa CEP Granada 2015
Robotica Educativa CEP Granada 2015Robotica Educativa CEP Granada 2015
Robotica Educativa CEP Granada 2015Jose Antonio Vacas
 
Fundamentos de programacion robotica con Arduino
Fundamentos de programacion robotica con ArduinoFundamentos de programacion robotica con Arduino
Fundamentos de programacion robotica con ArduinoChristian Farinango
 
Puerto d825 CU ZUMPANGO
Puerto d825 CU ZUMPANGOPuerto d825 CU ZUMPANGO
Puerto d825 CU ZUMPANGOLeida Zuñiga
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wiresharkhefloca
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wiresharkhefloca
 
T3ch fest leganes_final
T3ch fest leganes_finalT3ch fest leganes_final
T3ch fest leganes_finalRober Garamo
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wiresharktimmaujim
 
5.2.2.6 lab configuring dynamic and static nat - ilm
5.2.2.6 lab   configuring dynamic and static nat - ilm5.2.2.6 lab   configuring dynamic and static nat - ilm
5.2.2.6 lab configuring dynamic and static nat - ilmOmar E Garcia V
 
Arduino práctico comunicaciones
Arduino práctico   comunicacionesArduino práctico   comunicaciones
Arduino práctico comunicacionesJose Antonio Vacas
 
2016 11-09-urjc-fpgas-libres
2016 11-09-urjc-fpgas-libres2016 11-09-urjc-fpgas-libres
2016 11-09-urjc-fpgas-libresobijuan_cube
 
Taller practico iot fundación telefónica
Taller practico iot fundación telefónicaTaller practico iot fundación telefónica
Taller practico iot fundación telefónicaSara Alvarellos Navarro
 
Curso intensivo de arduino createc3 de mayo 2014
Curso intensivo de arduino createc3 de mayo 2014Curso intensivo de arduino createc3 de mayo 2014
Curso intensivo de arduino createc3 de mayo 2014Jose Antonio Vacas
 

Similar a Hardware Hacking Rad (20)

Introducción a Arduino
Introducción a ArduinoIntroducción a Arduino
Introducción a Arduino
 
Proyecto de arduino
Proyecto de arduinoProyecto de arduino
Proyecto de arduino
 
Robotica Educativa CEP Granada 2015
Robotica Educativa CEP Granada 2015Robotica Educativa CEP Granada 2015
Robotica Educativa CEP Granada 2015
 
Curso Arduino práctico 2014
Curso Arduino práctico  2014Curso Arduino práctico  2014
Curso Arduino práctico 2014
 
Fundamentos de programacion robotica con Arduino
Fundamentos de programacion robotica con ArduinoFundamentos de programacion robotica con Arduino
Fundamentos de programacion robotica con Arduino
 
Puerto d825 CU ZUMPANGO
Puerto d825 CU ZUMPANGOPuerto d825 CU ZUMPANGO
Puerto d825 CU ZUMPANGO
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
 
T3ch fest leganes_final
T3ch fest leganes_finalT3ch fest leganes_final
T3ch fest leganes_final
 
Sesion 1 Curso Arduino.pdf
Sesion 1 Curso Arduino.pdfSesion 1 Curso Arduino.pdf
Sesion 1 Curso Arduino.pdf
 
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark5.2.1.8 lab   observing arp with the windows cli, ios cli, and wireshark
5.2.1.8 lab observing arp with the windows cli, ios cli, and wireshark
 
Señales con arduino y DAC
Señales con arduino y DACSeñales con arduino y DAC
Señales con arduino y DAC
 
5.2.2.6 lab configuring dynamic and static nat - ilm
5.2.2.6 lab   configuring dynamic and static nat - ilm5.2.2.6 lab   configuring dynamic and static nat - ilm
5.2.2.6 lab configuring dynamic and static nat - ilm
 
Interfaz java y arduino
Interfaz java y arduinoInterfaz java y arduino
Interfaz java y arduino
 
Arduino práctico comunicaciones
Arduino práctico   comunicacionesArduino práctico   comunicaciones
Arduino práctico comunicaciones
 
Netduino
NetduinoNetduino
Netduino
 
2016 11-09-urjc-fpgas-libres
2016 11-09-urjc-fpgas-libres2016 11-09-urjc-fpgas-libres
2016 11-09-urjc-fpgas-libres
 
Puertos
PuertosPuertos
Puertos
 
Taller practico iot fundación telefónica
Taller practico iot fundación telefónicaTaller practico iot fundación telefónica
Taller practico iot fundación telefónica
 
Curso intensivo de arduino createc3 de mayo 2014
Curso intensivo de arduino createc3 de mayo 2014Curso intensivo de arduino createc3 de mayo 2014
Curso intensivo de arduino createc3 de mayo 2014
 

Más de Svet Ivantchev

Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Svet Ivantchev
 
Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Svet Ivantchev
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a ElixirSvet Ivantchev
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
Gaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlGaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlSvet Ivantchev
 
Gaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataGaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataSvet Ivantchev
 
Gaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotGaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotSvet Ivantchev
 
Gaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoGaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoSvet Ivantchev
 
Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Svet Ivantchev
 
How Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningHow Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningSvet Ivantchev
 
Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Svet Ivantchev
 
Libros electrónicos III
Libros electrónicos IIILibros electrónicos III
Libros electrónicos IIISvet Ivantchev
 
Libros electrónicos II - ePub
Libros electrónicos II - ePubLibros electrónicos II - ePub
Libros electrónicos II - ePubSvet Ivantchev
 
Libros electrónicos I
Libros electrónicos ILibros electrónicos I
Libros electrónicos ISvet Ivantchev
 
Cloud Computing: Just Do It
Cloud Computing: Just Do ItCloud Computing: Just Do It
Cloud Computing: Just Do ItSvet Ivantchev
 
Cloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsCloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsSvet Ivantchev
 
Los mitos de la innovación
Los mitos de la innovaciónLos mitos de la innovación
Los mitos de la innovaciónSvet Ivantchev
 

Más de Svet Ivantchev (20)

Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).Machne Learning and Human Learning (2013).
Machne Learning and Human Learning (2013).
 
Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)Big Data: 
Some Questions in its Use in Applied Economics (2017)
Big Data: 
Some Questions in its Use in Applied Economics (2017)
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Gaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot ControlGaztea Tech 2015: 4. GT Drawbot Control
Gaztea Tech 2015: 4. GT Drawbot Control
 
Gaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y FirmataGaztea Tech 2015: 3. Processing y Firmata
Gaztea Tech 2015: 3. Processing y Firmata
 
Gaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBotGaztea Tech 2015: 2. El GT DrawBot
Gaztea Tech 2015: 2. El GT DrawBot
 
Gaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al ArduinoGaztea Tech 2015: 1. Introducción al Arduino
Gaztea Tech 2015: 1. Introducción al Arduino
 
Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?Learning Analytics and Online Learning: New Oportunities?
Learning Analytics and Online Learning: New Oportunities?
 
How Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human LearningHow Machine Learning and Big Data can Help Us with the Human Learning
How Machine Learning and Big Data can Help Us with the Human Learning
 
Vienen los Drones!
Vienen los Drones!Vienen los Drones!
Vienen los Drones!
 
Data Science
Data ScienceData Science
Data Science
 
Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2Libros electrónicos IV: ePub 2
Libros electrónicos IV: ePub 2
 
Libros electrónicos III
Libros electrónicos IIILibros electrónicos III
Libros electrónicos III
 
Libros electrónicos II - ePub
Libros electrónicos II - ePubLibros electrónicos II - ePub
Libros electrónicos II - ePub
 
Libros electrónicos I
Libros electrónicos ILibros electrónicos I
Libros electrónicos I
 
Cloud Computing: Just Do It
Cloud Computing: Just Do ItCloud Computing: Just Do It
Cloud Computing: Just Do It
 
Cloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'TsCloud Computing: What it is, DOs and DON'Ts
Cloud Computing: What it is, DOs and DON'Ts
 
BigData
BigDataBigData
BigData
 
Los mitos de la innovación
Los mitos de la innovaciónLos mitos de la innovación
Los mitos de la innovación
 

Último

La era de la educación digital y sus desafios
La era de la educación digital y sus desafiosLa era de la educación digital y sus desafios
La era de la educación digital y sus desafiosFundación YOD YOD
 
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfPARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfSergioMendoza354770
 
EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveFagnerLisboa3
 
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricGlobal Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricKeyla Dolores Méndez
 
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxPlan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxpabonheidy28
 
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...silviayucra2
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)GDGSucre
 
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE  DE TECNOLOGIA E INFORMATICA PRIMARIACLASE  DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIAWilbisVega
 
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxHernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxJOSEMANUELHERNANDEZH11
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdfIsabellaMontaomurill
 
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...AlanCedillo9
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesFundación YOD YOD
 
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...FacuMeza2
 
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Josephguía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan JosephBRAYANJOSEPHPEREZGOM
 
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersSalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersIván López Martín
 
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptxProyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx241521559
 
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíaTrabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíassuserf18419
 
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024GiovanniJavierHidalg
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfsoporteupcology
 

Último (19)

La era de la educación digital y sus desafios
La era de la educación digital y sus desafiosLa era de la educación digital y sus desafios
La era de la educación digital y sus desafios
 
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfPARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
 
EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
 
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft FabricGlobal Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
 
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxPlan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docx
 
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)
 
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE  DE TECNOLOGIA E INFORMATICA PRIMARIACLASE  DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
 
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxHernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptx
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdf
 
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento Protégeles
 
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
 
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Josephguía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Joseph
 
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersSalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
 
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptxProyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx
 
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnologíaTrabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnología
 
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
 

Hardware Hacking Rad

  • 1. Hardware Hacking en Ruby: Arduino y RAD Esti Álvarez y Svet Ivantchev http://www.efaber.net Conferencia Rails 2008
  • 4. ¿Qué es Arduino? http://www.arduino.cc
  • 5. ¿Por qué Arduino? • Es Open Source • Es multiplataforma (Linux, Mac, Windows) • Se puede programar con cable USB • Pensado para hacer prototipos • El hardware es barato (30€)
  • 8. El Hardware • 14 pins IO digitales • 6 pins Input analógicos • 6 pins Output analógicos (PWM) • 16Kb memoria Flash (Apollo 11: 74 Kb) • 1Kbyte RAM (Apollo 11: 4Kb) • Microcontrolador ATMega168 a 16MHz • Alimentación por USB o pila de 9V
  • 9. Otras piezas • Sensores “binarios”: interruptores, termostatos, switches magnéticos, de posición, de luz, etc • Sensores “analógicos”: termistores, accelerómetros. • “Actuadores”: leds, motores, servos, LCDs
  • 10.
  • 11.
  • 13.
  • 14. Hello World: Hardware Pin 13 Arduino
  • 15. Hello World: Software /* Blink * The basic Arduino example.Turns on an LED on for one second, * http://www.arduino.cc/en/Tutorial/Blink */ int ledPin = 13; // LED connected to digital pin 13 void setup() { // run once, when sketch starts pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() { // run over and over again digitalWrite(ledPin, HIGH);// sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }
  • 16. Demo
  • 17.
  • 18. Demo
  • 19.
  • 20. Difuminado RGB: Hardware pin 9 pin 10 Arduino pin 11 PWM
  • 21. PWM
  • 22. /* Code for cross-fading 3 LEDs, RGB, or one tri-color LED */ int redPin = 9; int greenPin = 10; int bluePin = 11; int redVal = 255; int greenVal = 1; int blueVal = 1; int i = 0; // Loop counter void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { i += 1; // Increment counter if (i < 255) { redVal -= 1; greenVal += 1; blueVal = 1; } else if (i < 509) { redVal = 1; greenVal -= 1; blueVal += 1; } else if (i < 763) { redVal += 1; greenVal = 1; blueVal -= 1; } else { i = 1; } analogWrite(redPin, redVal); analogWrite(greenPin, greenVal); analogWrite(bluePin, blueVal); delay(10); // Pause for 10 milliseconds before resuming the loop }
  • 23. RAD: Ruby Arduino Development • Añadir a Arduino las ventajas de programar en Ruby • Convenciones y helpers inspirados en Rails • Testing Framework aprovechando el dinamismo de Ruby • Entorno de simulación gráfica usando “Shoes GUI”
  • 24. RAD: Ruby Arduino Development $ sudo gem install rad $ rad hello_world Successfully created your sketch directory. ... Added hello_world/hello_world2.rb Added hello_world/Rakefile Added hello_world/config Added hello_world/config/hardware.yml Added hello_world/config/software.yml
  • 25. RAD: Ruby Arduino Development $ ls -l hello_world -rw-r--r-- 1 esti esti 31 Rakefile drwxr-xr-x 4 esti esti 136 config drwxr-xr-x 42 esti esti 1428 examples drwxr-xr-x 7 esti esti 238 hello_world -rw-r--r--@ 1 esti esti 106 hello_world.rb drwxr-xr-x 5 esti esti 170 vendor
  • 26. Hello World class HelloWorld < ArduinoSketch output_pin 7, :as => :led def loop led.blink 500 end end
  • 27. Compilar y transferir $ rake make:upload
  • 28. Demo
  • 29.
  • 35. TwitAmbiLight • Comunicación por puerto serie • Datos del REST API de Twitter • Los colores de nuestra lámpara dependerán del humor de nuestros followers en Twitter.
  • 36. TwitAmbiLight: Ingredientes • 1 Arduino y 1 breadboard • 1 LED RGB y 3 resistencias de 220 ohms • 1 Cable USB y unos cuantos de conexión $ gem install toholio-serialport $ gem install twitter $ gem install mbbx6spp-twitter4r
  • 38. TwitAmbiLight: Hardware +5 V +5 V +5 V pin 11 USB pin 10 Arduino pin 9 PWM Internet
  • 39. TwitterAmbiLight: Software Ordenador # Se conecta al API de Twitter y busca colores en formato RGB # Hexadecimal entre los replies a @raduino # Ejemplo: @raduino #FF0000 %w(rubygems twitter serialport).each {|g| require g} gem 'mbbx6spp-twitter4r' # params para puerto serie port_str = quot;/dev/tty.usbserial-A4001lmtquot; # puede cambiar para ti baud_rate = 9600 data_bits = 8 stop_bits = 1 parity = SerialPort::NONE sp = SerialPort.new(port_str, baud_rate, data_bits, stop_bits, parity) ...
  • 40. def get_color_from_twitter client = Twitter::Client.new(:login => 'raduino', :password => 'mypass') last_status = client.status(:replies).first color = last_status.text.gsub('@raduino', '').strip || '' end 5.times do puts quot;Cojo el colorquot; color = get_color_from_twitter puts quot;Devuelve #{color}quot; if color.match(/#[A-F0-9]{6}$/i) puts quot;Envio en color al puerto seriequot; sp.write color end puts quot;-------------quot; sleep(10) end sp.close
  • 41. TwitterAmbiLight: Software Arduino class TwitAmbiLight < ArduinoSketch output_pin 9, :as => :red_led output_pin 10, :as => :green_led output_pin 11, :as => :blue_led r = 255; g = 255; b = 255 @first_byte = byte; @byte1 = byte; @byte2 = byte; @byte3 = byte @byte4 = byte; @byte5 = byte; @byte6 = byte serial_begin def setup red_led.digitalWrite HIGH green_led.digitalWrite HIGH blue_led.digitalWrite HIGH end ...
  • 42. ... def loop if serial_available # Si el primer byte es #, leer los 6 siguientes @first_byte = serial_read if @first_byte == '#' @byte1=serial_read; serial_print quot;Primer caracter:quot;;serial_println @byte1 @byte2 = serial_read; serial_print quot;2 caracter:quot;; serial_println @byte2 @byte3 = serial_read; serial_print quot;3 caracter:quot;; serial_println @byte3 @byte4 = serial_read; serial_print quot;4 caracter:quot;; serial_println @byte4 @byte5 = serial_read; serial_print quot;5 caracter:quot;; serial_println @byte5 @byte6 = serial_read; serial_print quot;6 caracter:quot;; serial_println @byte6 r = 255 - h2d(@byte1) * 16 + h2d(@byte2) g = 255 - h2d(@byte3) * 16 + h2d(@byte4) b = 255 - h2d(@byte5) * 16 + h2d(@byte6) end serial_print quot;Rojo: quot;; serial_println r serial_print quot;Verde: quot;; serial_println g serial_print quot;Azul:quot;; serial_println b red_led.analogWrite(r); green_led.analogWrite(g); blue_led.analogWrite(b) delay(100) end end ...
  • 43. ... def h2d(c) if c >= 48 && c <= 57 # c esta entre 0 y 9 return c - '0' elsif c >= 'A' && c <= 'F' # c esta entre A y F return c - 65 + 10 end end end
  • 44. Demo
  • 45. Opciones Wireless Zigbee GSM/GPRS 802. 11 Bluetooth 802.15.4 Moritorizado y Conectividad Aplicación Voz y datos Internet rápido control entre dispositivos Duración ~ semanas ~ días ~ horas ~ horas batería Ancho de 250 kbps Hasta 2 Mbps Hasta 54 Mbps 720 kbps banda Alcance típico 100-1000 metros Kilómetros 150-300 metros 10-100 metros Infraestructura Ventajas Bajo consumo Velocidad Comodidad existente
  • 46. XBee XBee Arduino Shield
  • 47. WiTwitAmbiLight: Hardware +5 V +5 V +5 V pin 11 serie Xbee pin 10 Arduino pin 9 802.15.4 Xbee serie Internet
  • 48. Demo
  • 49. Nunchuck como sensor • Interfaz I2C standard • Accelerómetro de 3 ejes • Joystick analógico de 2 ejes • 2 botones
  • 50. Ejemplo Nunchuck +5 V pin 11 serie Xbee pin 10 Arduino pin 9 PWM 802.15.4 i2c serie Xbee Arduino
  • 51. Demo
  • 52. Referencias • Getting Started with Arduino. Make Magazine • http://www.arduino.cc/ • http://rad.rubyforge.org/ • http://github.com/atduskgreg/rad/tree/master • http://todbot.com/blog/bionicarduino/
  • 53. Algunos ejemplos • http://www.cs.colorado.edu/~buechley/LilyPad/ build/turn_signal_jacket.html • http://vimeo.com/1261369 • http://vimeo.com/1650051 • http://www.botanicalls.com/kits/