voodootikigod / voodoospark

A RPC based firmware for a Spark Core device (like being connected, but without the wire!)
MIT License
145 stars 35 forks source link

Servo control no longer functional #9

Closed rwaldron closed 10 years ago

rwaldron commented 10 years ago

This used to work, now it doesn't.

voodootikigod commented 10 years ago

will dig into it!

voodootikigod commented 10 years ago

can you provide sample code?

makenai commented 10 years ago

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

makenai commented 10 years ago

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

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

rwaldron commented 10 years ago
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
});
rwaldron commented 10 years ago

https://github.com/unittest-cpp/unittest-cpp

voodootikigod commented 10 years ago

https://github.com/rwaldron/spark-io/pull/13