SunFounder pisloth
Note: You can download and print the PDF Cartoon Mask for your PiSloth.
Run the Code
cd /home/pi/pisloth/examples
sudo python3 dancing.py
The whole dance is divided into 2 parts, and PiSloth will finish these 2 parts with the music. If you don’t stop the
code, it will repeat the dance.
Code
Note: You can Modify/Reset/Copy/Run/Stop the code below. But before that, you need to go to source code path
like pisloth\examples. After modifying the code, you can run it directly to see the effect.
from pisloth import Sloth
from robot_hat import Music
from robot_hat import Ultrasonic
from robot_hat import Pin
import time
import os
music = Music()
sloth = Sloth([1,2,3,4])
(continues on next page)
4.3. Dance 81