Build a Candy Counting Robot with the Raspberry Pi.
5. Set up the Code
First, let’s make sure the volume is up and running on the Raspberry Pi. In the command line run:
Next, install espeak. Run the following in terminal:
sudo apt-get install espeak -y
After it is successfully installed, run the following command. (Disregard error messages on the terminal if you can hear sound):
If you are able to hear “hello” from the headphones or the speakers then move to the next step!
sudo nano /etc/rc.local
In the file, add in the line:
python /home/pi/Desktop/GrovePi/Projects/Candy-Counting-Robot-Costume/robot.py &
This should go into the file ABOVE the final exit command, and below any other commands.
Optional: Customize the WiFi Access Point
As we mentioned above, the robot costume is going to have its own WiFi Access Point. We do this through CINCH, a version of Raspbian For Robots, which automatically opens up a WiFi Access Point. This can be handy for debugging or restarting the costume on the fly with a phone or laptop (not that you want to haul one around while trick-or-treating, but hey . . . maybe you’re that person!). It can also be a cute party trick: “She’s also a WiFi Access Point!”
You can customize the pages served up by the Raspberry Pi access point by rewriting the HTML files in the directory:
Add in any extra pictures or code you want to run. When someone logs into the WiFi Access Point “dex” they’ll see this web page at the address “10.10.10.10”.