Last active
August 29, 2016 23:31
-
-
Save jongio/0f354313489ccd7a138df3c902d00cdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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