
We have already looked at responding to touch using bump switches, but another way to respond to this kind of action is to look at the motor readings from the servos. Doing this, we can tell when pressure is placed on Marty’s arms and program him to respond, for example, to carry out a handshake with someone!
Lessons 1.1-1.16
1. Talk to students about what happens when we put a force on something, i.e. it usually moves or if it is a button then something happens
2. We have already programmed Marty to respond to touch using bump switches but another way we can do this is by reading the motor values
3. In small groups, get students to create a number of variables that hold the motor value for Marty’s left and right arms (note that students might want to multiply the value by 1000 to get a value that is easier to read!)
a. Note down what the values are when he is stationary, and nothing is touching him
b. Does this change when he walks?
c. What about when we gently apply some pressure onto one of his arms?
4. Program Marty to take part in a short handshake with someone when he feels a force on his arm (when the value is greater than 3)
a. Experiment with using different values here instead of 3 to start a handshake
5. Extend the handshake to create a unique and secret handshake between your group and Marty