Thursday, October 4, 2007
Replacing LED output with Flexinol
This week our group focused mainly on altering our output along with experimenting with the coding. First off we tried out our new flexinol which had a .01" diameter. We spent a while double checking our wire configuration along with the simple coding and yet no motion. We tested the .006" flexinol prior so I'm not quite sure what the problem could be. Next we did some testing on the "2 input/4 output" coding to see if we could simultaneously work the input of the infrared sensor and the photoresistor. Again, no luck. Either the photoresister or the infrared would essentially override the other. After this we exchanged the LED output for the flexinol and it worked! Pretty easy really. If you want, you can use the same configuration on the bread board from the first assignment that introduces flexinol. Plug in the photoresistor and alter the coding a little bit and you're done. Here's the Coding we used:
' {$STAMP BS2}
' {$PBASIC 2.5}
PIR PIN 2
TIME VAR Word
DEBUG "STARTIN!"
MAIN:
DO
GOSUB GET_RC_TIME_PHOTORESISTOR
GOSUB DELAY_PHOTORESISTOR
GOSUB UPDATE_DISPLAY_A
LOOP
GET_RC_TIME_PHOTORESISTOR:
HIGH 2
PAUSE 100
RCTIME 2, 1, TIME
DEBUG DEC TIME, CR
RETURN
UPDATE_DISPLAY_A:
IF TIME=7THEN
DEBUG "TRIPZORD 2", CR
HIGH 4
PAUSE 4000
ENDIF
LOW 4
RETURN
DELAY_PHOTORESISTOR:
PAUSE TIME
RETURN
_______________________________________________________
I personally like the GoSub's for organization... Makes mistakes much easier to catch. Especially if you use Debugs within them. If the .01" Diameter flexinol wire had worked our next step would have been to exchange all the LED's from out video 1 input 3 output to Flexinol wire. This would have been a great test this to see if the transistor or the voltage output would have been sufficient for such a procedure. I believe the coding and wiring on the breadboard would most definitely not be a problem.
' {$STAMP BS2}
' {$PBASIC 2.5}
PIR PIN 2
TIME VAR Word
DEBUG "STARTIN!"
MAIN:
DO
GOSUB GET_RC_TIME_PHOTORESISTOR
GOSUB DELAY_PHOTORESISTOR
GOSUB UPDATE_DISPLAY_A
LOOP
GET_RC_TIME_PHOTORESISTOR:
HIGH 2
PAUSE 100
RCTIME 2, 1, TIME
DEBUG DEC TIME, CR
RETURN
UPDATE_DISPLAY_A:
IF TIME=7THEN
DEBUG "TRIPZORD 2", CR
HIGH 4
PAUSE 4000
ENDIF
LOW 4
RETURN
DELAY_PHOTORESISTOR:
PAUSE TIME
RETURN
_______________________________________________________
I personally like the GoSub's for organization... Makes mistakes much easier to catch. Especially if you use Debugs within them. If the .01" Diameter flexinol wire had worked our next step would have been to exchange all the LED's from out video 1 input 3 output to Flexinol wire. This would have been a great test this to see if the transistor or the voltage output would have been sufficient for such a procedure. I believe the coding and wiring on the breadboard would most definitely not be a problem.
Labels: smartskin