Assignment: Simple Mechanics: Cuckoo Clock
Collaborators: sohyeong, michael_lee
In this lab we created a simple cuckoo clock mechanism. We used a variety of different building materials to create a little house and actuate the cuckoo with a mounted servo motor. Our cuckoo moves forward with a simple jointed linkage extended along a cardboard slot, while the door is opened from above by a string attached to the linkage and strung over a pulley. In addition, we created some short programs to make the cuckoo's motion dependant on a network event - in this case, it's someone pushing a button on a website, but we could imagine the cuckoo as a semi-ambient device triggered by website visits, e-Commerce sales, a new email, etc.
Components Used
Sketch
Images
Python Code for Network Monitoring
#
# TUI - Cuckoo Init
#
import time
import urllib
import serial
arduino = serial.Serial('COM11', 9600)
cuckooData = 'http://people.ischool.berkeley.edu/~mikaly/classes/tui/cuckoo/cuckoo.txt'
last_counter = urllib.urlopen(cuckooData).read()
while (True):
counter = urllib.urlopen(cuckooData).read()
change = int(counter) - int(last_counter)
print "counter: %s, change: %s" % (counter, change)
arduino.write(chr(ord(chr(change))))
last_counter = counter
time.sleep(20)