Update
For this assignment Rebecca continued working on updating the code while I kept experimenting with the Garth puppet to see what range of movements I could achieve with the servo motors. Unfortunately while I was putting my set up together I broke one of my alligator clips and couldn’t fully test out the new code with the soft sensor pads! Because of this I decided to continue forward with focusing on one servo unit and setting it both horizontally and vertically and testing with the length of strings.
Once I achieved the correct length of strings needed to keep the arms and head elevated, I set the servo unit so it would lay horizontally across my bookcase. While laying the servo horizontally did achieve some arm movement, it made the puppet head tilt forward more than I wanted to and body twist and turn. It also turned the puppet into a pendulum which made it rock back and forth.
When I set the servo vertically similarly to what I did in class and shortened the strings, it made the arm movements more dynamic, which in turn made the puppet’s body move left to right as opposed to back and forth. I preferred this type of movement compared to the previous.
Code Update
touched = 0
# ----------------------------------------------------------------
# Begin the main processing loop.
while True:
# Read the integer sensor value and scale it to a value in Volts.
volts = sensor.value * scaling
pressure = (1.4 - volts) / (1.4 - 0.1)
speed = getSpeed(pressure)
touched = 0 if switch.value else 1
# Move the motor according to the speed of the pressure
if touched != last_touch:
last_touch = touched
for angle in range(0, 90, speed):
actuator.angle = angle
time.sleep(0.02)
For the code, I was able to implement a pressure sensed software that would use pressure as an indicator for speed, and the switch as in on value. We are hoping next to tackle the look of the buttons and controls.
Leave a Reply
You must be logged in to post a comment.