servo: Modified output of JavaScript example

Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
This commit is contained in:
Sarah Knepper 2015-01-22 20:10:28 -08:00
parent 2fce7369f4
commit de70ed8694

View File

@ -43,11 +43,11 @@ function startServo(timeOffset, timeInterval, angle)
// Start running this instance after timeOffset milliseconds
setTimeout(function()
{
console.log("Starting angle is " + angle);
// run this instance every timeInterval milliseconds
setInterval(function()
{
servo.setAngle(angle);
console.log("Set angle to " + angle);
}, timeInterval);
}, timeOffset);
// timeOffset tells setTimeout when