Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codiejs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codiejs

A Node.js library to control a Codie robot

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 = new Codie("Codie_001"); // pass your codie's name to the constructor
codie.connect(function (error) {
    if (!error) {
        // do something with codie
    }
});
Commands
Move
codie.move (distance, leftSpeed, rightSpeed, cb);
Enable motors
codie.enableMotorBoth (leftSpeed, rightSpeed, cb);
Enable left motor
codie.enableMotorLeft (speed, cb);
Enable right motor
codie.enableMotorRight (speed, cb);
Turn

Note:

  • positive speed -> left turn
  • negative speed -> right turn
codie.turn (angle, speed, cb);
Beep
codie.beep (volume, frequency, duration, cb);
Set led colour
codie.setColor (hue, saturation, value, cb);
Start animation

Possible animation values: 0, 1

codie.setAnimation (animation, hue, saturation, repeat, speed, cb);
Sensors
Distance
codie.getDistance (cb(sensorData));
Battery
codie.getBattery (cb(sensorData));
Sound
codie.getSound (cb(sensorData));
Light
codie.getLight (cb(sensorData));
Line
codie.getLine (cb(sensorData));

Keywords

FAQs

Package last updated on 18 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc