During this workshop we will be using mbots from Makeblock. These robots are quick to construct but can be used to do a variety of activites including:
- Control remotely over bluetooth
- Use distance sensors for obstacle detection
- Play a tune via a speaker
- Detect lines and follow them
And all of this can be done using JavaScript via NodeJS and Johnny Five.
You will need the following:
- a ticket to the workshop as this includes the cost of an mBot within it. You will be able to take this home with you after the session for more hacking.
- A laptop with a recent desktop OS (Win, Mac, Linux all fine)
- A sense of fun and desire to learn new things
- Some JavaScript knowledge
Before you come to the workshop please ensure you've done the tasks below. On a good internet connection this process takes about 20 minutes. On poor conference wifi or 3G you may be looking at over an hour to do this on the day which means you'll get less value out of the session.
- Install Arduino for your OS. If you have it installed, please update it to a recent 1.6.x version.
- Install NodeJS. Note that there are problems with NodeJS 4.x - as such
use 0.12.7 for the moment. If you are using
v4 then please ensure you have and know how to use
nvm
and have 0.12.7 installed for use. - Test installation of
johnny-five
. You can do this usingnpm install johnny-five
. If you get any errors, drop into the Johnny Five Gitter and we can get you sorted out. - Git clone this GIST into a new folder
- From a command line in the folder run
npm install
to get the dependencies - Make sure you have
./node_modules/.bin/
on your $PATH variable so you can run executable scripts local to the project. - Install the drivers (Win / Mac only) for the mBot from
node_modules/mbot_nodebots/drivers
(see mBot readme for more )
Bookmark this page in order to get any latest updates required before the session.
These are the things to do in the workshop (assume you've done the bits above).
Install firmata using interchange
interchange install git+https://github.com/Makeblock-official/mbot_nodebots -a uno -p <port> --firmata=usb
Make the onboard LED attached to pin 13 blink using the code below save to a file called led.js in the root of your project folder.
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var led = five.Led({pin:13});
led.blink(1000);
});
Use the examples in node_modules/mbot_nodebots/examples
to learn more about
the capabilities of your robot.
More examples are available at http://johnny-five.io