Robots powered by JavaScript using Johnny-Five

Julio César Rodríguez Domínguez

NodeBots enthusiast

@_JuraseC

Arduino

  • Surge como proyecto educativo de bajo costo.
  • Plataforma Open Hardware.
  • Hace que los ordenadores puedan sentir y controlar el mundo físico.
  • Multiplataforma.
  • Arduino UNO: Cuenta con 6 entradas analógicas y 14 pines digitales de I/O (6 soportan PWM Pulse-Width Modulation) 
  • Una gran variedad de Shields.

Shields

  • Son placas compatibles con Arduino (mismo form-factor) , el cual permite extender las capacidades.
  • Se conectan una encima de otra

Node.js

Node.js es ...

  • Una herramienta de línea de comandos.
  • Te permite ejecutar código de JavaScript desde tu terminal.
$ node app.js
> Hi, im a node app!
  • El código es ejecutado por el V8 JavaScript Engine.
  • Cuenta con un gran número de librerías listas para usarse.

Multi-thread server Vs Node server

Node event loop

In Node.js everything runs in parallel, except your code. What this means is that all I/O code that you write in Node.js is non-blocking, while (conversely) all non-I/O code that you write in Node.js is blocking

var fs = require('fs'),
    sys = require('sys');

fs.readFile('treasure-chamber-report.txt', function(report) {
  sys.puts("oh, look at all my money: "+report);
});

fs.writeFile('letter-to-princess.txt', '...', function() {
  sys.puts("can't wait to hear back from her!");
});

http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb

Non-blocking I/O operations

Johnny Five

Johnny-Five is an Open Source, IoT and Robotics programming framework, developed at Bocoup. Johnny-Five programs can be written for Arduino, Beagle Bone, Intel Galileo & Edison, Pinoccio, Raspberry Pi, Spark Core, TI Launchpad and more!

Nodebots

Representación de las capas de un NodeBot

  • Leer datos de sensores.
  • Mandar información a actuadores.
  • Controlar carritos.
  • Peleas de sumo.
  • Jugar futbol.
  • Lanzar cohetes.
  • Alimentador automático de peces y caballos.
  • Muchas cosas mas ...

Muestrame que se puede hacer!

Ejemplos:

Links

Happy Hacking!

@_JuraseC

UPTapachula-NodeBots-Demo

By Julio César

UPTapachula-NodeBots-Demo

  • 1,573