Johnny-Five on tinylab.
I got my tinylab last week; it's a nifty little prototyping board with an Arduino Leonardo and a bunch of embedded components that was funded on IndieGoGo. So naturally I wanted to get Johnny-Five working and start fiddling with the tinylab as soon as possible. Unfortunately, it seems like the hardest part of every hardware project is the grand upgrading of the softwares that must proceed fiddling. Here's the process that worked for me.
- Re-install Node. My Node installation was a few versions old, and somehow npm was missing. So I went ahead and installed Node.js from https://nodejs.org/en/download/. I decided to live dangerously and install the "Current" version rather than the Stable one.
- Upgrade Arduino.app. My Arduino install was older than the Leonardo, so I needed to upgrade it too. I got version 1.6.10 from https://www.arduino.cc/en/Main/Software.
-
Upgrade npm packages.
npm outdated
showed that several packages (including Johnny Five) were out of date. This required a few rounds ofnpm update
. -
Write the Johnny Five code. I checked the excellent Johnny Five docs and wrote this code for the first LED on the tinylab.
var five = require("johnny-five"); var board = new five.Board(); board.on("ready", function(){ var led = new five.Led(13); led.pulse(1000); });
This should make LED1 (on pin D13) pulse on an off. At first I tried using"D13"
to address the LED (since that's what's silk-screened on the board) but it was just13
that worked.
Success!
Here is some tinylab documentation that might come in handy next time:
Permalink
Tags: code johnny-five maker node nodebots tinylab