This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Gpio = require('pigpio').Gpio, | |
motor = new Gpio(10, {mode: Gpio.OUTPUT}); | |
setInterval(function () { | |
motor.servoWrite(1000); | |
setTimeout(function () { | |
motor.servoWrite(2000); | |
}, 1500); | |
}, 3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var EventEmitter = require('events').EventEmitter, | |
Gpio = require('onoff').Gpio, | |
Q = require('q'), | |
util = require('util'), | |
tick = global.setImmediate || process.nextTick; | |
var __ROW_OFFSETS = [0x00, 0x40, 0x14, 0x54]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var assert = require('assert'), | |
i2c = require('i2c-bus'), | |
i2c1; | |
var ADDR = 0x53, | |
POWER_REG = 0x2d, | |
RANGE_REG = 0x31, | |
READ_REG = 0x32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The target system is: Linux - - i686 | |
The host system is: Linux - 3.13.0-74-generic - i686 | |
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. | |
Compiler: /usr/bin/c++ | |
Build flags: | |
Id flags: | |
The output was: | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brian@linuxbox:~$ ./oneshot.sh | |
1. install dependencies | |
[sudo] password for brian: | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
autoconf is already the newest version. | |
autoconf2.13 is already the newest version. | |
bison is already the newest version. | |
flex is already the newest version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debian@beaglebone:~/dev/sp10$ node -v | |
v0.10.38 | |
debian@beaglebone:~/dev/sp10$ npm install serialport | |
\ | |
> serialport@2.0.2 install /home/debian/dev/sp10/node_modules/serialport | |
> node-pre-gyp install --fallback-to-build | |
make: Entering directory '/home/debian/dev/sp10/node_modules/serialport/build' | |
CXX(target) Release/obj.target/serialport/src/serialport.o | |
CXX(target) Release/obj.target/serialport/src/serialport_unix.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pi@raspberrypi ~/dev/j5 $ node -v | |
v4.2.0 | |
pi@raspberrypi ~/dev/j5 $ npm install git://github.com/rwaldron/johnny-five.git | |
> firmata@0.7.1-pre-2 postinstall /home/pi/dev/node_modules/johnny-five/node_modules/firmata | |
> node scripts/postinstall | |
/ | |
> serialport@2.0.1 install /home/pi/dev/node_modules/johnny-five/node_modules/firmata/node_modules/serialport | |
> node-pre-gyp install --fallback-to-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pi@raspberrypi ~/dev $ npm install git://github.com/jgautier/firmata.git | |
- | |
> firmata@0.7.1-pre-2 postinstall /home/pi/dev/node_modules/firmata | |
> node scripts/postinstall | |
> serialport@2.0.1 install /home/pi/dev/node_modules/firmata/node_modules/serialport | |
> node-pre-gyp install --fallback-to-build | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/power.h> | |
#include <util/delay.h> | |
#define LED PB0 | |
#define LED_DDR DDRB | |
#define LED_PORT PORTB | |
#define USART_BAUDRATE 115200 | |
#define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var SerialPort = require('serialport').SerialPort; | |
var calls = 0; | |
var serialPort = new SerialPort('/dev/ttyAMA0', { | |
baudrate: 115200, | |
parser: function() { | |
calls++; |