Tutorial - Sphero changes color
After completing this tutorial, you will be familiar with the most important concepts needed to play with artoo and sphero. If you are new to this world, don't worry; this tutorial should cover all you need to make it work.
- Before we start, be sure to have Ruby and Artoo installed. , along with Gort
- You should have Bluetooth in your computer.
install artoo sphero gem:
gem install artoo-sphero
Pair your sphero device via Bluetooth
- Turn on your Sphero by shaking it.
- Go to Mac OS Bluetooth preferences, click “Set Up New Device”, and follow the onscreen instructions to set up your sphero.
- Turn on your Sphero by shaking it,
- Click on the Bluetooth notification icon, make sure Bluetooth is ON, and click "Set Up new Device".
- Select the Sphero from the Bluetooth list of devices and follow the on-screen instructions to connect the Bluetooth device.
Communicate with your device
- Find out serial port address by running this command:
Run this command to look for it:
gort scan bluetooth
You will see the following output:
Scanning ... 00:06:66:44:39:C6 Sphero-YBW
Use that output to connect your device by name running this command:
gort bluetooth connect 00:06:66:44:39:C6 Sphero-YBW
Run artoo program
- Download color example.
- Open a new terminal .
Navigate to the directory where you put the example file:
You will need to change the port to the device port
connection :sphero, :adaptor => :sphero, :port => '/dev/Sphero-YBW'
Sphero should be changing colors through the rainbow and moving around.
Congratulations you have completed succesfully this tutorial.