Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Currently available for work. Let's talk!

Ron Evans deadprogram

💭
Currently available for work. Let's talk!
View GitHub Profile

Insert cool title here...

Problems with current KR:

Backend stuff

@deadprogram
deadprogram / README.md
Last active August 29, 2015 13:56
Test Driver Robotics with Cylon.js

How to install:

You will need to be using the HEAD of the 'tdr' branch of Cylon.js itself.

sudo npm install sinon-chai -g
sudo npm install mocha -g
npm install cylon-firmata

####Installation instructions

  • You will need node.js as well as satisfying the dependencies listed here
  • Once you have the required dependencies met, you can install the required node modules with
    $ npm install cylon cylon-gpio cylon-i2c cylon-firmata cylon-sphero cylon-leapmotion
  • Install the leap motion software (and SDK too if you want, but the SDK is not needed for cylon.js)

####Arduino blink

//blink.js
var Cylon = require('cylon');
var Cylon = require('cylon');
Cylon.robot({
connection: {
name: 'voodoospark',
adaptor: 'voodoospark',
accessToken: 'XXX',
deviceId: 'YYY',
module: 'spark'
},
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
var Cylon = require('cylon');
Cylon.robot({
connection: [{ name: 'rapiro', adaptor: 'rapiro', port: '/dev/ttyAMA0' },
{ name: 'speech', adaptor: 'speech', voice: 'en-f3' }],
devices: [{name: 'rapiro', driver: 'rapiro', connection: 'rapiro'},
{name: 'mouth', driver: 'speech', connection: 'speech'}],
work: function(my) {
var walking = false ;
var Cylon = require('cylon');
Cylon.robot({
connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/tty.Sphero-YBW-RN-SPP' },
device: { name: 'sphero', driver: 'sphero' },
setColor: function(color) {
my.sphero.setColor(color);
},
peripheral with UUID d03972a24e55 found
Manufacturer Data = 0005ffffffff643ed1
Service Data =
services and characteristics:
180a (Device Information)
2a23 (System ID)
properties read
value 554ea200007239d0 | 'UN"r9P'
2a26 (Firmware Revision String)
"use strict";
var Cylon = require("cylon");
Cylon.api("http", {host: "0.0.0.0", ssl: false});
var Green = 0x0000FF,
Red = 0xFF0000;
var bots = {