voodootikigod/voodoospark

Servo control no longer functional

rwaldron opened this issue · 7 comments

This used to work, now it doesn't.

will dig into it!

can you provide sample code?

Glad it wasn't just me. I think I might have run into the same issue and was mid-debugging.

Here's what I was doing - simple hack on my original sumobot example code:

https://gist.github.com/makenai/6616049372c17a220fa4

var five = require("../lib/johnny-five.js");
var Spark = require("spark-io");
var board = new five.Board({
  io: new Spark({
    token: "...",
    deviceId: "..."
  })
});

board.on("ready", function() {
  var sc = new five.Servo.Continuous("D5");

  sc.cw();
});

w/o Johnny-Five

var Spark = require("../lib/spark");
var board = new Spark({
  token: "...",
  deviceId: "..."
});

board.on("ready", function() {
  console.log("CONNECTED");

  this.pinMode("D5", this.MODES.SERVO);
  // Analog write to a digital pin for Servos
  this.analogWrite("D5", 150);

  // This should just make the continuous servo turn
});