Wednesday, October 06, 2004

Lab 3 10.06.04 - Analogue Output

Group Project with Chia Hao, please use this link for a full description of the Weathervane.



The reading was "Chapter One: What exactly is interactivity" by Chris Crawford. Crawford makes the case for interactivity and defines what it as a conversation. Crawford writes that you need two actors for interaction - these actors think, listen, and speak. Crawford defines activities such as reading as not interactive. He is heavy handed in his conclusion because linear art forms like books and movies can be the genesis of interactivity and discussion. Crawford cites an example from Greek antiquity to support his claim that the spoken word is better than the written. The conclusion addresses "web" generation and interaction designers and draws the distinction between UI designers and human factors.

The lab assignment was to hook up output to a servo motor. I still need to try audio output with a potentiometer. The main difficulty with the servo motor was ensuring that connections were solid on the Radio Shack breadboard and the servo wires which are really thin.

Here is the code to turn the servo to it's maximum position and start again:


start:
pulseWidth var byte
' set up constants with the minimum and maximum pulsewidths
minPulse CON 50
maxPulse CON 250
' set up a constant with the time between pulses:
refreshPeriod CON 20

' set an initial pulsewidth:
pulseWidth = minPulse

main:
'take the output pin low so we can pulse it high
Low PORTC.3
' pulse the pin
PulsOut PORTC.3, pulseWidth
' pause for as long as needed:
Pause refreshPeriod

' change the angle for the next time around:
IF pulseWidth > maxPulse Then
pulseWidth = minPulse
Else
pulseWidth = pulseWidth + 1
Endif

GoTo main