KEMBAR78
Hardware for JavaScript Developers | PDF
Hardware 
Development for 
JavaScript Developers 
Tarık Keleştemur" 
• github/tkelestemur! 
• twitter/tarikkelestemur! 
• kelestemur.com
About Me 
• Electronics Engineering Student at TOBB ETU #3 
• Co-Founder at GMTLabs.com 
• Working on embedded sys. and robotics 
! 
! 
more info : kelestemur.com
Agenda 
• A Brief History of Electronic Prototyping 
• It's all about C. How JS involved ? - Main Concept 
• JS Hardware Frameworks 
• Demonstration 
! 
! 
!
Hardware Prototyping 
• Texas Instruments 
• IBM 
• Atmel 
• Microchip 
! 
! 
! 
! 
!
Electronic for Everyone : Arduino 
• 16MHz micro-controller 
• Easy programming with Wiring 
• Open Source! 
• Great for driving motors, 
reading sensors BUILDING ROBOTS! 
! 
!
Electronic for Everyone : Other 
! 
!
The Problem 
• Micro-controllers are running at low speeds. 
• They are not capable of handling high-level jobs 
such as math, media processing 
• They are programmed with C language. 
• C does not have awesome JavaScript libraries. 
!
The Solution 
• Using JavaScript as controller software of these hardwares. 
! 
! 
! 
NODEJS + 
HW Framework 
uController + 
Special Firmware 
Serial Comm 
• Serial communication is made by a node package called serialport 
• Special Firmware let you control your hardware over serial 
comminaciton with JavaScript. We don't write any C code :)
Hardware Frameworks 
! 
! 
! 
! 
! 
Johnny-Five Cylon.JS
Johnny-Five 
• Compitable with almost every electronic board : 
Beagle Bone, Intel Galileo,Pinoccio,Raspberry Pi, Spark 
Core, Arduino of course. 
• Uses node-serialport package by Chris Williams 
• Has a large community : NodeBots, NodeCopter, 
NodeRocket 
!
Johnny-Five 
• Accelerometer, Button, Compass, Led, Joystick, 
Motor, (Ultrasonic) Ping, Proximity IR, Range IR, 
Sensor, Servo, Sonar 
• http://jsfiddle.net/rwaldron/XMsGQ/show/light/
Johnny-Five Examples 
var five = require("johnny-five"); 
five.Board().on("ready", function() { 
(new five.Led(13)).strobe(100); 
}); 
• It says arduino to blink the led atteched to pin13 in every 
100 ms over serial port.
var five = require("johnny-five"); 
five.Board().on("ready", function() { 
var claw, joystick; 
// Claw servo controller 
claw = new five.Servo(9); 
// Joystick controller 
joystick = new five.Joystick({ 
// x, y (vertical, horizontal) 
pins: [ "A0", "A1" ] 
}); 
! 
// Center the claw servo to match the joystick deadzone. 
claw.center(); 
! 
// When the joystick axis are moved... 
joystick.on("axismove", function() { 
// Open & close the claw by setting degrees according 
// to Y position value of joystick. 
claw.move( Math.ceil(180 * this.fixed.y) ); 
}); 
}); 
https://dl.dropboxusercontent.com/u/3531958/nodeconf/joystick-claw.mp4
Demos 
• Arduino : Blinking LED, Servo, Reading Sensor Data 
• Spark Core : Internet of Things Example 
! 
!
Thank You! Questions ? 
• Tarık Keleştemur 
• kelestemur.com 
• twitter/tarikkelestemur 
• github/tkelestemur 
• tkelestemur@gmail.com 
! 
!

Hardware for JavaScript Developers

  • 1.
    Hardware Development for JavaScript Developers Tarık Keleştemur" • github/tkelestemur! • twitter/tarikkelestemur! • kelestemur.com
  • 2.
    About Me •Electronics Engineering Student at TOBB ETU #3 • Co-Founder at GMTLabs.com • Working on embedded sys. and robotics ! ! more info : kelestemur.com
  • 3.
    Agenda • ABrief History of Electronic Prototyping • It's all about C. How JS involved ? - Main Concept • JS Hardware Frameworks • Demonstration ! ! !
  • 4.
    Hardware Prototyping •Texas Instruments • IBM • Atmel • Microchip ! ! ! ! !
  • 5.
    Electronic for Everyone: Arduino • 16MHz micro-controller • Easy programming with Wiring • Open Source! • Great for driving motors, reading sensors BUILDING ROBOTS! ! !
  • 6.
  • 7.
    The Problem •Micro-controllers are running at low speeds. • They are not capable of handling high-level jobs such as math, media processing • They are programmed with C language. • C does not have awesome JavaScript libraries. !
  • 8.
    The Solution •Using JavaScript as controller software of these hardwares. ! ! ! NODEJS + HW Framework uController + Special Firmware Serial Comm • Serial communication is made by a node package called serialport • Special Firmware let you control your hardware over serial comminaciton with JavaScript. We don't write any C code :)
  • 9.
    Hardware Frameworks ! ! ! ! ! Johnny-Five Cylon.JS
  • 10.
    Johnny-Five • Compitablewith almost every electronic board : Beagle Bone, Intel Galileo,Pinoccio,Raspberry Pi, Spark Core, Arduino of course. • Uses node-serialport package by Chris Williams • Has a large community : NodeBots, NodeCopter, NodeRocket !
  • 11.
    Johnny-Five • Accelerometer,Button, Compass, Led, Joystick, Motor, (Ultrasonic) Ping, Proximity IR, Range IR, Sensor, Servo, Sonar • http://jsfiddle.net/rwaldron/XMsGQ/show/light/
  • 12.
    Johnny-Five Examples varfive = require("johnny-five"); five.Board().on("ready", function() { (new five.Led(13)).strobe(100); }); • It says arduino to blink the led atteched to pin13 in every 100 ms over serial port.
  • 13.
    var five =require("johnny-five"); five.Board().on("ready", function() { var claw, joystick; // Claw servo controller claw = new five.Servo(9); // Joystick controller joystick = new five.Joystick({ // x, y (vertical, horizontal) pins: [ "A0", "A1" ] }); ! // Center the claw servo to match the joystick deadzone. claw.center(); ! // When the joystick axis are moved... joystick.on("axismove", function() { // Open & close the claw by setting degrees according // to Y position value of joystick. claw.move( Math.ceil(180 * this.fixed.y) ); }); }); https://dl.dropboxusercontent.com/u/3531958/nodeconf/joystick-claw.mp4
  • 14.
    Demos • Arduino: Blinking LED, Servo, Reading Sensor Data • Spark Core : Internet of Things Example ! !
  • 15.
    Thank You! Questions? • Tarık Keleştemur • kelestemur.com • twitter/tarikkelestemur • github/tkelestemur • tkelestemur@gmail.com ! !