To try it out make sure you use the latest backpack from ajfisher/nodebots-hcsr04 using i2c_multiping branch
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
// Ensure that you've done npm install johnny-five before you run this. | |
const five = require('johnny-five'); | |
const board = new five.Board({port: process.argv[2]}); | |
board.on("ready", function() { | |
// Create a standard `led` component instance | |
var led = new five.Led(13); |
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
/* | |
Basic ESP8266 MQTT example | |
This sketch demonstrates the capabilities of the pubsub library in combination | |
with the ESP8266 board/library. | |
It connects to an MQTT server then: | |
- publishes "hello world" to the topic "outTopic" every two seconds | |
- subscribes to the topic "inTopic", printing out any messages | |
it receives. NB - it assumes the received payloads are strings not binary |
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
{ | |
"name": "lasertest", | |
"version": "1.0.0", | |
"description": "Used to pan tilt and fire a laser", | |
"main": "led.js", | |
"dependencies": { | |
"johnny-five": "^0.9.53" | |
}, | |
"devDependencies": {}, | |
"scripts": { |
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 five = require("johnny-five"); | |
var board = five.Board(); | |
//Define Data Command Parameters | |
var Mode_Address_Auto_Add_1 = 0x40 //0100 0000 B | |
var Mode_Permanent_Address = 0x44 //0100 0100 B | |
board.on("ready", function() { |
Get bin file from this gist.
Copy bin file into a location on the edison side. I'll call this /tmp/firmware
ssh onto edison then cd into /tmp/firmware
from there:
npm install avrgirl-arduino
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 MIT License (MIT) | |
Copyright (c) 2015 ajfisher | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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 five = require("johnny-five"); | |
var colour_sensor = require("./coloursensor.js") | |
var board = five.Board(); | |
var led; | |
board.on('ready', function() { | |
var cs = new colour_sensor({ | |
address: 0x29, |
NewerOlder