Puedo usar Javascript con Hardware?

@juliocesar_io

https://juliocesar.io

Javascript Robotics

  • Open Hardware
  • Open Source
  • Precios accesibles
  • Comunidades
  • Hackers, gente cool

HOY

La IOT es trendy

Numeros, blah.

Oh, V8, Nodejs

Historia, Chromium, Google, blah

Con que podemos empezar HOY?

NodeBots are robotics that are made accessible to JavaScript developers.

Johnny Five

var five = require('johnny-five');
var board = new five.Board();

board.on('ready', function () {
  var led = new five.Led(13);

  led.blink();
});
$ npm install johnny-five

led.js

$ [sudo] node led.js

Blink a Led

Abstractions

module.exports = {
  Accelerometer: require("./accelerometer"),
  Animation: require("./animation"),
  Board: require("./board"),
  Button: require("./button"),
  Compass: require("./compass"),
  Distance: require("./distance"),
  ESC: require("./esc"),
  Gripper: require("./gripper"),
  Gyro: require("./gyro"),
  IR: require("./ir"),
  LCD: require("./lcd"),
  Led: require("./led"),
  LedControl: require("./ledcontrol"),
  Joystick: require("./joystick"),
  Motor: require("./motor"),
  Nodebot: require("./nodebot"),
  Piezo: require("./piezo"),
  Ping: require("./ping"),
  Pir: require("./pir"),
  Relay: require("./relay"),
  Sensor: require("./sensor"),
  Servo: require("./servo"),
  ShiftRegister: require("./shiftregister"),
  Sonar: require("./sonar"),
  Stepper: require("./stepper"),
  Switch: require("./switch"),
  Wii: require("./wii")
};

Cylon

Boards

and more...

Demo Time

http://voyager.readthedocs.io

Voyager's High­level diagram

Voyager's Arquitecture

Voyager's Arquitecture

Voyager's "Framework"

De eventos en el navegador

A bits en el hardware

Evento en el navegador

"keys": "up",
"on_keydown": function() {
    socket.emit('goForward');

Emite un socket

Inicio Jhonny Five

board = new five.Board();

board.on("ready", function() {
    // Codigo cool
});

Abre el puerto serial

Socket recibido

    socket.on('goForward', function(){
        // Turn on right motor
        that.digitalWrite(rMotorN1, 1);
        that.digitalWrite(rMotorN2, 0);
        that.analogWrite(rMotorNA, speed);
        // Turn on left motor
        that.digitalWrite(lMotorN3, 0);
        that.digitalWrite(lMotorN4, 1);
        that.analogWrite(lMotorNB, speed);
    });

Se ejecuta codigo en arduino

Al ejecutar con Nodejs

Se establece comunicacion con exito

Forkme on Github

NodeBots Community

International NodeBots Day

July 27

All around the world

EMPEZAMOS NODEBOTS EN MONTERIA !!!

juliocesar.io

@juliocesar_io

THX !!!

Puedo usar Javascript con Hardware?

By Julio César

Puedo usar Javascript con Hardware?

  • 985