Simple API for sphero 1 and 2.0 written in C++.
The API is (for now) built only over the bluez bluetooth stack, making it compatible with most recent Linux distributions. It will NOT work on osx systems as of now.
Sphero reference doc: http://docs-beta.gosphero.com/reference/
User Hack mode reference: https://s3.amazonaws.com/docs.gosphero.com/api/Sphero_Shell_Commands_1.0.pdf
Sphero collision detection: https://s3.amazonaws.com/docs.gosphero.com/api/Collision%20detection.pdf
locator reference: https://s3.amazonaws.com/docs.gosphero.com/api/Sphero%20Locator%201.1.pdf
full api reference: https://s3.amazonaws.com/docs.gosphero.com/api/Sphero_API_1.20.pdf
full macro reference: https://s3.amazonaws.com/docs.gosphero.com/api/Sphero_Macros.pdf
orbBasic refenrence, with plenty examples: https://s3.amazonaws.com/docs.gosphero.com/api/Sphero_orbBasic.pdf
Dependencies are: bluez, libbluetooth, libbluetooth-dev, and libreadline6-dev libncurses5 libncurses5-dev (and of course, classic compilation tools : g++, make, gcc, clib, git, ...)
$ sudo apt-get install bluez libbluetooth libbluetooth-dev git libreadline6-dev libncurses5 libncurses5-dev
Some distros may have libbluetooth called libbluetooth3 and libreadline6 called libreadline, use your favorite package manager to figure out dependancies you can't install using the provided command, these are quite usual packages so they should be available for you
$ git clone https://github.com/slock83/sphero-linux-api.git
$ cd sphero-linux-api/sphero-api
$ make
$ cd example-app
$ make
still in the example-app folder, do
$ ./sphero-cli
Command | Effect | Usage |
---|---|---|
help | Shows the application help | |
connect | Connects to a sphero via bluetoth | connect xx:xx:xx:xx:xx |
list | Lists all available sphero | list |
select | Select which sphero you want to drive | select id |
changeColor | Changes the led color | changeColor red green blue colorPersists |
backled | Changes the back LED intensity | backled intensity |
roll | Makes the sphero roll at the specified speed and angle | roll speed angle |
ping | Sends a ping to the sphero to witch it should answer ASAP | ping |
sleep | Puts the sphero to sleep for the given amount of time, it will then wake up and we will try to connect back to him | sleep duration |
interactive | Switch to interactive driving mode | interactive |
setit | Change inactivity timeout | setit duration |
exit | Closes the application | exit |
A graphical application is also being worked on by the team! please check out https://github.com/slock83/sphero-command-app for more details