Out of all of the circuits and techniques we've learned thus far in this course, I feel that this one has the most potential and room for creativity. The possibilities are endless with regards to the things that you can do with motion activity. Whether it be turning a light on or off, activating sound or video, or making something move, this is one of the most basic and preliminary techniques that you could use within a New Media installation. I look forward to next semester when we are able to put this basic function to further use. I couldn't figure out why I was unable to get this circuit to work in the beginning, but I soon discovered that I had to ground the sensor, which solved all my problems.
Code:
' {$STAMP BS2sx} ' {$PBASIC 2.5}
' control an LED switch a switch ' using an IF..THEN structure
' ****** variables ************
mySwitch VAR BIT ' looking at a switch so only a BIT is required
' ****** setup ********
myLed CON 1 ' connect a digital out to this PIN
' **** processing ************
DO 'read the state of switch mySwitch = IN0 DEBUG ? mySwitch
' write state of switch to myLED IF mySwitch = 0 THEN LOW myLed ELSE HIGH myLed ENDIF
No comments:
Post a Comment