But I get this error when I use any of the example files. Is the code too old?
Arduino: 1.8.7 (Mac OS X), Board: "Arduino/Genuino Uno"
In file included from /Users/MYNAME/Documents/Arduino/libraries/Arduino-Sphero-Library-master/examples/SpinMeRightRound/SpinMeRightRound.ino:10:0:
/Users/MYNAME/Documents/Arduino/libraries/Arduino-Sphero-Library-master/Sphero.h:14:20: fatal error: Serial.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The reason the library claims it only works on the Mega is because it uses Serial1, which the Uno does not have (it only has Serial). The library should also work on any other board with Serial1 (e.g. Leonardo, Pro Micro).
I was able to compile the library for Uno after doing a global search and replace from Serial1. to Serial. in both the Arduino-Sphero-Library and Arduino-Bluetooth-Library folders. I don't own a Sphero so I can't tell whether it actually works. In this case, you would connect the Bluetooth module to pins 0 and 1 of your Uno. The problem with that is pins 0 and 1 are also used for communication between the Uno and your computer over the USB cable. Connecting anything to those pins can interfere with that communication. You may need to disconnect the Bluetooth module before you can upload to the Uno. It also can get very tricky if you are trying to send debug output to the Serial Monitor using Serial.print(), etc. (which uses pins 0 and 1) at the same time as communicating with the Bluetooth module module via those pins.
Some discussion on this topic here:
What I find incredibly annoying is that the author didn't bother to document the library dependencies. I had to search around to find the Arduino-Bluetooth-Library here:
and the SabertoothSimplified library here (I used the ".zip file" link because there's no way I'm messing with an "installer" for an Arduino library): https://www.dimensionengineering.com/info/arduino
Note that the latter is three libraries mashed into a single .zip file so it's a little more complicated to install.