Andrey Kucherenko
Creator and curator of training platform for developers - https://startupemulator.com/. Math.random() community leader - https://t.me/mathrandomcommunity Engineer with more than 21 years of experience in IT.
Andrey Kucherenko
Maxim Kryachko
var Cylon = require('cylon');
Cylon.robot({
connections: {
edison: { adaptor: 'intel-iot' }
},
devices: {
led: { driver: 'led', pin: 13 }
},
work: function(my) {
every((1).second(), my.led.toggle);
}
}).start();
var Cylon = require('cylon');
Cylon.robot({
connections: {
edison: {adaptor: 'intel-iot'},
sphero: {adaptor: 'sphero', port: "/dev/rfcomm0"}
},
devices: {
sphero: {driver: 'sphero', connection: 'sphero'}
},
work: function (my) {
var color = process.argv[2] || 0xFF0000;
my.sphero.color(color);
}
});
Cylon.start();
var Cylon = require('cylon');
Cylon.robot({
connections: {
edison: { adaptor: 'intel-iot'},
sphero: { adaptor: 'sphero', port: '/dev/rfcomm0' }
},
devices: {
led: { driver: 'led', pin: 13, connection: 'edison' },
sphero: { driver: 'sphero', connection: 'sphero' }
},
work: function(my) {
my.sphero.stop();
my.sphero.detectCollisions();
my.sphero.on('collision', function() {
my.led.toggle();
});
}
}).start();
var Cylon = require('cylon');
Cylon.robot({
connections: {
sphero: { adaptor: 'sphero', port: '/dev/rfcomm0' }
},
devices: {
sphero: { driver: 'sphero' }
},
work: function(my) {
var flag = true;
var color = 0x00FF00,
bitFilter = 0xFFFF00;
console.log("Setting up Collision Detection...");
my.sphero.on("collision", function() {
console.log("Collision:");
color = color ^ bitFilter;
console.log("Color: " + (color.toString(16)) + " ");
my.sphero.color(color);
});
my.sphero.detectCollisions();
every((2).second(), function () {
my.sphero.roll(60, flag ? 190 : 10);
flag = !flag;
});
}
}).start();
var Cylon = require('cylon');
Cylon.robot({
connections: {
bebop: { adaptor: 'bebop' }
},
devices: {
drone: { driver: 'bebop' }
},
work: function(my) {
my.drone.takeOff();
after((5).seconds(), my.drone.land);
}
}).start();
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
By Andrey Kucherenko
IoT presentation for OdessaJS 2015 conference
Creator and curator of training platform for developers - https://startupemulator.com/. Math.random() community leader - https://t.me/mathrandomcommunity Engineer with more than 21 years of experience in IT.