0.1.1 • Published 12 years ago

reflecta_moto1 v0.1.1

Weekly downloads
6
License
-
Repository
github
Last release
12 years ago

Reflecta Monster Moto

Reflecta Monster Moto exposes commands to allow a host to control a Sparkfun Monster Moto Shield over the Arduino's USB or UART (Serial) port.

The commands exposed are:

  • Drive (power0, power1): Turn on the motors using power levels from -255 to 255
  • BrakeGround: Coast to a stop
  • BrakeVcc: Hard brake using battery power to halt the drive shafts
  • ReadCurrent: Read the current consumed by the motors

To install this library, upload sketch ReflectaMonsterMoto to your Arduino. Note that you must first install the Reflecta Arduino libraries.

To call this library, use the Reflecta Node Client library. A simple example is:

var devicePath = "/dev/ttyACM0"; // or "COM4" in Windows
var Reflecta = require('reflecta.js');
var reflecta = new Reflecta(devicePath, function(err) {
  reflecta.moto1.drive(75, 75);
  reflecta.moto1.brakeGround();
});

Future Work

  • Add error checking for power levels
  • Add nodejs sample program that translatest joystick -> drive commands