hardware for javascript developers
DESCRIPTION
How to build hadware projects using JavaScript.TRANSCRIPT
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.
!
!
!
• 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
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 Examplesvar 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 • [email protected] !
!