Slide 1

Slide 1 text

HARDWARE HACKING WITH JAVASCRIPT

Slide 2

Slide 2 text

ANDREW NESBITT

Slide 3

Slide 3 text

ELECTRONICS, ROBOTICS AND INTERNET OF THINGS FOR WEB DEVELOPERS

Slide 4

Slide 4 text

MY ROBOT STORY

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

BEng Robotics & Automated Systems University of Plymouth

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Advanced Mathematics Mechanical Engineering Digital Electronics Analogue Electronics Computer Science Control Theory Neural Networking Microprocessor Design Playing with Robots LEARNING ROBOTICS

Slide 11

Slide 11 text

Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Observing Robots behind glass LEARNING ROBOTICS

Slide 12

Slide 12 text

Hardware was expensive, complicated and not fun

Slide 13

Slide 13 text

APIs Open Source Hardware Smart phones Dynamic Programming Languages GitHub Mobile Internet 3D Printing 2014

Slide 14

Slide 14 text

HARDWARE HACKING WITH JAVASCRIPT

Slide 15

Slide 15 text

WHY JAVASCRIPT?

Slide 16

Slide 16 text

Any application that can be written in JavaScript, will eventually be written in JavaScript

Slide 17

Slide 17 text

HIGH LEVEL ASYNC COMMUNITY INTERNET OF THINGS LOW BARRIERS

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

It's a UNIX system! I know this!

Slide 20

Slide 20 text

LEGO

Slide 21

Slide 21 text

EV3

Slide 22

Slide 22 text

Demo Time

Slide 23

Slide 23 text

ROBOT RABBIT FEEDER

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Server-side Javascript Asynchronous Runs on v8 from Chrome Perfect for network programs

Slide 28

Slide 28 text

http://nodejs.org/download/ ! nodejs.org/download v0.10.32 $ node $ npm install ar-drone

Slide 29

Slide 29 text

! 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 };

Slide 30

Slide 30 text

! 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
 })
 });
 });


Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

github.com/andrew/node-ev3-robot

Slide 34

Slide 34 text

github.com/clebert/ev3

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

ARDUINO

Slide 37

Slide 37 text

FIRMATA

Slide 38

Slide 38 text

Cat Laser Toy

Slide 39

Slide 39 text

Cat Laser Toy Rabbit | v

Slide 40

Slide 40 text

! 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)
 }) 


Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

hobbytronics.co.uk/sparkfun-inventors-kit-v3 Sparkfun Inventors Kit

Slide 43

Slide 43 text

node-ardx.org

Slide 44

Slide 44 text

JAVASCRIPT MICROCONTROLLERS

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

£70 £21 £30 £40 Lua based Tiny-js Node.js or browser Node.js Plug and play Hacker friendly Tiny computer All the ports

Slide 50

Slide 50 text

NODECOPTER

Slide 51

Slide 51 text

PROGRAMMATIC FLYING ROBOTS

Slide 52

Slide 52 text

HD Camera Down-facing camera Gyroscope Wifi 1GHz CPU Linux Accelerometer Magnetometer Ultrasound

Slide 53

Slide 53 text

GITHUB.COM/FELIXGE/NODE-AR-DRONE

Slide 54

Slide 54 text

! 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();
 });

Slide 55

Slide 55 text

shama.github.com/voxel-drone

Slide 56

Slide 56 text

DEMO TIME

Slide 57

Slide 57 text

WARNING

Slide 58

Slide 58 text

QR CODER

Slide 59

Slide 59 text

Dance Dance Drone

Slide 60

Slide 60 text

github.com/eschnou/ardrone-webflight

Slide 61

Slide 61 text

Quadcopters as a Service

Slide 62

Slide 62 text

ROBOT LASER PONG

Slide 63

Slide 63 text

WRAPPING UP

Slide 64

Slide 64 text

STAY ON THE EDGE OF YOUR COMFORT ZONE

Slide 65

Slide 65 text

BRING EVERYTHING GREAT ABOUT THE INTERNET TO THE REAL WORLD

Slide 66

Slide 66 text

GO FORTH AND HACK

Slide 67

Slide 67 text

No animals were harmed in the making of this presentation Thanks!

Slide 68

Slide 68 text

github.com/andrew Thanks!

Slide 69

Slide 69 text

Thanks! @teabass