Download - JavaScript in the Real World
![Page 1: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/1.jpg)
Javascriptin the
real world
![Page 2: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/2.jpg)
Andrew Nesbitt
@teabassgithub.com/andrew
![Page 3: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/3.jpg)
Bertie
@BertramRabbitMr April 2014
![Page 4: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/4.jpg)
![Page 5: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/5.jpg)
![Page 6: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/6.jpg)
Any application that can be written in JavaScript,
will eventually be written in JavaScript
![Page 7: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/7.jpg)
![Page 8: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/8.jpg)
patrick-wied.at/static/nudejs/
![Page 9: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/9.jpg)
patrick-wied.at/static/nudejs/
![Page 11: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/11.jpg)
reddit.com/r/atwoodslaw
![Page 12: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/12.jpg)
BuildcatAlex Potsides
![Page 13: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/13.jpg)
github.com/achingbrain/build-cat
![Page 14: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/14.jpg)
Hardware hackingwith Javascript
![Page 15: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/15.jpg)
Why JAvascript?
![Page 16: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/16.jpg)
Higher Level
![Page 17: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/17.jpg)
Async
![Page 18: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/18.jpg)
Lower Barriers
![Page 19: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/19.jpg)
Javascript is popular871,108 JS repos on github
![Page 20: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/20.jpg)
Internet of things
![Page 21: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/21.jpg)
Hardware
![Page 22: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/22.jpg)
Arduino
![Page 23: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/23.jpg)
Johnny-fivegithub.com/rwaldron/johnny-five
![Page 24: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/24.jpg)
Firmata
![Page 25: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/25.jpg)
var five = require("johnny-five"); var board = new five.Board(); board.on("ready", function() { led = new five.Led({ pin: 9 }); board.repl.inject({ led: led }); led.pulse(500); this.wait( 10000, function() { led.stop().off(); }); });
![Page 26: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/26.jpg)
Kinect Controlled Arm
![Page 27: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/27.jpg)
Biped Nodebot
![Page 28: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/28.jpg)
Cat Laser Toy
![Page 29: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/29.jpg)
Rabbit Laser Toy
![Page 30: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/30.jpg)
var five = require("johnny-five"), board = new five.Board(); function randomFromInterval(from,to){ return Math.floor(Math.random()*(to-from+1)+from); } board.on("ready", function() { var servoX = new five.Servo(10); var servoY = new five.Servo(9); var laser = new five.Led(8); laser.on() setInterval(function(){ x = randomFromInterval(80, 120) y = randomFromInterval(95, 145) servoX.move(x) servoY.move(y) }, 400) })
![Page 31: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/31.jpg)
DEMO
![Page 32: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/32.jpg)
![Page 33: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/33.jpg)
github.com/rwaldron/johnny-five
![Page 34: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/34.jpg)
SparkfunInventors Kithobbytronics.co.uk/sparkfun-inventors-kit-v3
![Page 35: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/35.jpg)
node-ardx.org
![Page 36: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/36.jpg)
LEGO
![Page 37: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/37.jpg)
EV3
![Page 38: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/38.jpg)
![Page 39: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/39.jpg)
var Ev3 = require ("ev3-nodejs-bt"); var Ev3_base = Ev3.base; var XboxController = require('xbox-controller'); var xbox = new XboxController; var robot = new Ev3_base("/dev/tty.EV3-SerialPort"); var maxAngle = 32768; var maxSpeed = 100; var speeds = { a: 0, b: 0, c: 0, d: 0 };
![Page 40: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/40.jpg)
robot.connect(function(){ robot.start_program(function(ev3){ var setSpeed = function(){ var output = ev3.getOutputSequence(speeds.a,speeds.b,speeds.c,speeds.d); ev3.sp.write(output); } setInterval(setSpeed, 100) xbox.on('left:move', function(position){ var x = -(position.x / maxAngle)*-maxSpeed var y = (position.y / maxAngle)*-maxSpeed var left = y-x var right = y+x speeds.b = left speeds.a = right }) xbox.on('a:press', function(){ speeds.d = 100 }) xbox.on('a:release', function(){ speeds.d = 0 }) }); });
![Page 41: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/41.jpg)
DEMO
![Page 42: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/42.jpg)
![Page 43: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/43.jpg)
![Page 44: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/44.jpg)
github.com/andrew/node-ev3-robot
![Page 45: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/45.jpg)
github.com/clebert/ev3
![Page 46: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/46.jpg)
Linux running on lego
![Page 47: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/47.jpg)
Nodecopter
![Page 48: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/48.jpg)
Programmatic Flying Robots
![Page 49: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/49.jpg)
HD Camera
Downfacing camera
Gyroscope
Wifi 1GHz CPU
Linux
Accelerometer Magnetometer
Ultrasound
![Page 50: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/50.jpg)
github.com/felixge/node-ar-drone
![Page 51: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/51.jpg)
var arDrone = require('ar-drone'); var client = arDrone.createClient();
client.takeoff();
client .after(5000, function() { this.clockwise(0.5); }) .after(3000, function() { this.animate('flipLeft', 15); }) .after(1000, function() { this.stop(); this.land(); });
![Page 52: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/52.jpg)
QR CodeR
![Page 53: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/53.jpg)
Dance Dance Drone
![Page 54: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/54.jpg)
DEMO
![Page 55: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/55.jpg)
WARNING
![Page 56: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/56.jpg)
github.com/eschnou/ardrone-webflight
![Page 57: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/57.jpg)
Quadcoptersas a
Service
![Page 58: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/58.jpg)
robot laser pong
![Page 59: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/59.jpg)
JavaSCript Microcontrollers
![Page 60: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/60.jpg)
![Page 61: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/61.jpg)
![Page 62: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/62.jpg)
![Page 63: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/63.jpg)
ArduinoYun
![Page 64: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/64.jpg)
£70 £21 £30 £55
Lua based Tiny-jsNode.js or browser
Node.js
plug and play Hacker friendly Tiny computer Arduino++
![Page 65: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/65.jpg)
JavaSCript Hardwarein the browser
![Page 66: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/66.jpg)
In DevelopmentVibration apiAmbient light sensorProximity sensorTCP Socket APIwiki.mozilla.org/WebAPI
![Page 67: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/67.jpg)
Future?UDP Datagram Socket APIWebNFCWebUSBWebBluetoothwiki.mozilla.org/WebAPI
![Page 68: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/68.jpg)
whatwg.github.io/serial
![Page 69: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/69.jpg)
Go forth and make robots
![Page 70: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/70.jpg)
No animals were harmed in the making of this presentation
Thanks!
![Page 71: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/71.jpg)
Bonus Content
![Page 72: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/72.jpg)
Kinect Drone
![Page 73: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/73.jpg)
NoDebots.io
![Page 74: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/74.jpg)
![Page 75: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/75.jpg)
![Page 76: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/76.jpg)
MakeyMakey
![Page 77: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/77.jpg)
Rabbit Photo Booth
![Page 78: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/78.jpg)
<html><body> <video id="v" width="300" height="300" style="display:none;"></video> <canvas id="c" style="display:none;" width="300" height="300"></canvas> <div id='images'></div></body><script> var video = document.getElementById("v"), canvas = document.getElementById("c"), div = document.getElementById('images'); navigator.mozGetUserMedia({video: true}, function(stream) { video.src = window.URL.createObjectURL(stream); video.play() });
takePhoto = function(){ canvas.getContext("2d").drawImage(video, 0, 0, 300, 300); var img = canvas.toDataURL("image/png"); var image = new Image(); image.width = 320 image.height = 240 div.appendChild(image); image.src = img; } window.onkeypress = function(k){ if(k.charCode === 103){ takePhoto() } }</script></html>
![Page 79: JavaScript in the Real World](https://reader038.vdocuments.mx/reader038/viewer/2022103000/5565af53d8b42a4c6f8b4c17/html5/thumbnails/79.jpg)