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
/*
* 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: 'voodoospark',
adaptor: 'voodoospark',
accessToken: 'XXX',
deviceId: 'YYY',
module: 'spark'
},

####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');
@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

Insert cool title here...

Problems with current KR:

Backend stuff

@deadprogram
deadprogram / 1_sphero_color.rb
Created February 7, 2014 16:28
Artoo example code for the LARubyConf 2013 Robot Hackathon
require 'artoo'
connection :sphero, :adaptor => :sphero, :port => '127.0.0.1:4560'
device :sphero, :driver => :sphero
work do
every(3.seconds) do
if @color == :green
@color = :blue
else
require 'artoo'
connection :ardrone, :adaptor => :ardrone
device :drone, :driver => :ardrone, :connection => :ardrone
connection :navigation, :adaptor => :ardrone_navigation
device :nav, :driver => :ardrone_navigation, :connection => :navigation
work do
on drone, :ready => :fly
require 'artoo'
connection :ardrone, :adaptor => :ardrone
device :drone, :driver => :ardrone, :connection => :ardrone
work do
on drone, :ready => :fly
drone.start
end
$ artoo install digispark
run littlewire.rb install 1.2 from "."
Will upload to a littlewire which has been updated with the micronucleus bootloader, or to a digispark.
Plug in micronucleus device now: (waiting)
Attached to device: <Micronucleus 1.02: 5.9 kb programmable>
Writing program in to device's memory
erasing
erased chip
uploading @ 0 of 6010
uploading @ 64 of 6010
ron@ron-Dell-System-XPS-L322X:~/Development/artoo/artoo-digispark (master)
$ bundle exec ruby examples/wiichuck.rb
I, [2013-09-14T18:35:57.361940 #26729] INFO -- : Registering connection 'digispark'...
I, [2013-09-14T18:35:57.362049 #26729] INFO -- : Registering device 'board'...
I, [2013-09-14T18:35:57.362116 #26729] INFO -- : Registering device 'wiichuck'...
I, [2013-09-14T18:35:57.362183 #26729] INFO -- : Preparing work...
I, [2013-09-14T18:35:57.363255 #26729] INFO -- : Initializing connection digispark...
I, [2013-09-14T18:35:57.368321 #26729] INFO -- : Initializing device board...
I, [2013-09-14T18:35:57.386891 #26729] INFO -- : Initializing device wiichuck...
I, [2013-09-14T18:35:57.395551 #26729] INFO -- : Starting work...