codiejs
Disclaimer: This library is implemented to work with a specific version of the codie robots, that don't use the routing parameter. If you have a robot that doesn't work with this, feel free to submit an issue on GitHub. I'll contact you for further details and we'll try to add support for that as well. Let's make it a true community project!
A Node.js module to control a Codie robot. This module was written originally for a codie-server component that allows a Codie to be controlled remotely or use them in apps like Skratch(X), but generalized enough to use it in other custom apps.
License
This module is licensed under AGPL, please take this into consideration when re-using.
Usage
Requirements
This module uses noble to communicate over bluetooth, and noble has some heavy requirements. Setting up on a mac is fairly easy, you only need xcode, and node-gyp, but on Windows it' a whole different story. Please see noble's documentation for more info.
Installation
npm install codiejs
API
Connect
var codie = "Codie_001"; // pass your codie's name to the constructorcodie;
Commands
Move
codie;
Enable motors
codie;
Enable left motor
codie;
Enable right motor
codie;
Turn
Note:
- positive speed -> left turn
- negative speed -> right turn
codie;
Beep
codie;
Set led colour
codie;
Start animation
Possible animation values: 0, 1
codie;
Sensors
Distance
codie;
Battery
codie;
Sound
codie;
Light
codie;
Line
codie;