Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hardware Development for JavaScript Developers

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for JSIST JSIST
September 27, 2014

Hardware Development for JavaScript Developers

JSIST 2014
By : Tarık Keleştemur
http://jsist.org

Avatar for JSIST

JSIST

September 27, 2014
Tweet

More Decks by JSIST

Other Decks in Programming

Transcript

  1. About Me • Electronics Engineering Student at TOBB ETU #3

    • Co-Founder at GMTLabs.com • Working on embedded sys. and robotics ! ! more info : kelestemur.com
  2. Agenda • A Brief History of Electronic Prototyping • It's

    all about C. How JS involved ? - Main Concept • JS Hardware Frameworks • Demonstration ! ! !
  3. Electronic for Everyone : Arduino • 16MHz micro-controller • Easy

    programming with Wiring • Open Source! • Great for driving motors,
 reading sensors BUILDING ROBOTS! ! !
  4. 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. !
  5. The Solution • Using JavaScript as controller software of these

    hardwares. ! ! ! • 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 :) NODEJS + 
 HW Framework uController +
 Special Firmware Serial Comm
  6. 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 !
  7. Johnny-Five • Accelerometer, Button, Compass, Led, Joystick, Motor, (Ultrasonic) Ping,

    Proximity IR, Range IR, Sensor, Servo, Sonar • http://jsfiddle.net/rwaldron/XMsGQ/show/light/
  8. 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.
  9. 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
  10. Demos • Arduino : Blinking LED, Servo, Reading Sensor Data

    • Spark Core : Internet of Things Example ! !
  11. Thank You! Questions ? • Tarık Keleştemur • kelestemur.com •

    twitter/tarikkelestemur • github/tkelestemur • [email protected] ! !