Skip to content

Instantly share code, notes, and snippets.

@jongio
Last active August 29, 2016 23:31
Show Gist options
  • Select an option

  • Save jongio/0f354313489ccd7a138df3c902d00cdb to your computer and use it in GitHub Desktop.

Select an option

Save jongio/0f354313489ccd7a138df3c902d00cdb to your computer and use it in GitHub Desktop.
var sphero = require("sphero"),
sprkp = sphero("F3:F2:6D:55:71:09"); // change BLE address accordingly
sprkp.connect(function() {
// roll sprkp in a random direction, changing direction every second
setInterval(function() {
var direction = Math.floor(Math.random() * 360);
sprkp.roll(150, direction);
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment