Internet of Things for Web Developers

Andrii Kucherenko

Maxim Kryachko

What?

Why?
How?

What is it?

Connect physical world to Internet 

Why we need it?

Convenience 

Security

Saving

How can we start?

Hardware platforms

Software frameworks

Chair's health

var raspi = require('raspi-io');
var five = require('johnny-five');
var storage = require('./myStorage');

var board = new five.Board({
  io: new raspi()
});

board.on('ready', function() {

  var sensor = new five.Sensor({
    pin: "A0",
    freq: 250
  });

  sensor.scale([0, 200]).on("data", function() {
      storage.save(this.value, this.raw);
  });

});

Flower Pot

Flower Pot

var board = new five.Board({
  io: new raspi()
});

io.on('connection', function(socket) {
  socket.on('start.servo', function() {
    servo.to(110);
    setTimeout(function() {
      servo.to(10);
    }, 1000);
  });

  sensor = {
    initialize: function() {
      return sensorLib.initialize(22, 4);
    },
    read: function() {
      var readout = sensorLib.read();
      console.log('Temperature: ' + readout.temperature.toFixed(2) + 'C, ' +
        'humidity: ' + readout.humidity.toFixed(2) + '%');

      socket.emit('data.update', {
        temp: readout.temperature.toFixed(2),
        hum: readout.humidity.toFixed(2)
      });
      setTimeout(function() {
        sensor.read();
      }, 1000);
    }
  };
  sensor.initialize();
  sensor.read();
});

Parrot Ar.Drone

var arDrone = require('ar-drone');
var client  = arDrone.createClient();

client.takeoff();

client
  .after(5000, function() {
    this.clockwise(0.5);
  })
  .after(3000, function() {
    this.stop();
    this.land();
  });
var arDrone = require('ar-drone');
var client  = arDrone.createClient();
client.createRepl();


$ node repl.js
// Make the drone takeoff
drone> takeoff()
true
// Wait for the drone to takeoff
drone> clockwise(0.5)
0.5
// Let the drone spin for a while
drone> land()
true
// Wait for the drone to land

Questions?

Internet of Things for Web Developers

By Andrey Kucherenko

Internet of Things for Web Developers

  • 858
Loading comments...

More from Andrey Kucherenko