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

Hardware Development for JavaScript Developers

4cf764dcd5d1efc1de7051603bdf8215?s=47 JSIST
September 27, 2014

Hardware Development for JavaScript Developers

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

4cf764dcd5d1efc1de7051603bdf8215?s=128

JSIST

September 27, 2014
Tweet

Transcript

  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 • A Brief 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. Electronic for Everyone : Other ! !

  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. ! ! ! • 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
  9. Hardware Frameworks ! ! ! ! ! Johnny-Five Cylon.JS

  10. 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 !
  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 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.
  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 ! !