This is just a regular ticklish robot in a rocking chair. Come to think of it, that does not sound very regular at all. Tickle the robot on its heart and it will start to wiggle like crazy.
Materials
- 1 Arduino Uno board
- 1 Education Shield
- 1 breadboard
- 1 standard servo
- 1 1M ohm resistor
- 3 jumper wires
- Tickle Robot kit
- Aluminum foil
- Masking tape
- Thread
Instructions
Code
Find the code in File>Examples>EducationShield>Block4-Robots>Projects>TickleRobot
How it works
- The EducationShield, Servo and CapacitiveSensor libraries are included.
- The Servo and CapacitiveSensor objects are declared,
pull
andsensor
. - In
setup()
, the sensor and servo are configured and initialized. - In
loop()
, if the read value from sensor is true, it means that the capacitive switch is touched, and the servo position is set to 0 degrees so it pulls the strings. - If the read value is not true, the servo position is set to 90 degrees so it stops pulling the strings.
- The program pauses for 30 milliseconds.
loop()
continues to loop.
Troubleshooting
- Refer to the illustration and double check your connections. Make sure the shield and jumper wires are firmly connected.
- If it does not react to tickling or the servo does not move to the correct angle, see Standard Servo reference for debugging standard servo.
- If still not working, see the Capacitive sensor reference to for debugging.
Learn by doing
- Try to make the Tickle robot dance according to a predefined way or make it dance just after it is touched.
- Add another servo so it gets more advanced dancing moves.
- Make the robot rock the chair by itself. Use the capacitive sensor to turn it on and off.