Difference between revisions of "Lipstick grabber"
From RoboWiki
Line 26: | Line 26: | ||
PAUSE 1000 | PAUSE 1000 | ||
HIGH 1 | HIGH 1 | ||
− | |||
FOR counter = 1 TO 100 'take | FOR counter = 1 TO 100 'take | ||
PULSOUT 14, 500 | PULSOUT 14, 500 | ||
PAUSE 5 | PAUSE 5 | ||
NEXT | NEXT | ||
− | |||
FOR counter = 1 TO 100 'go forward | FOR counter = 1 TO 100 'go forward | ||
PULSOUT 14, 500 | PULSOUT 14, 500 | ||
Line 38: | Line 36: | ||
PAUSE 5 | PAUSE 5 | ||
NEXT | NEXT | ||
− | |||
FOR counter = 1 TO 60 'turn left | FOR counter = 1 TO 60 'turn left | ||
PULSOUT 14, 500 | PULSOUT 14, 500 | ||
Line 45: | Line 42: | ||
PAUSE 5 | PAUSE 5 | ||
NEXT | NEXT | ||
− | |||
FOR counter = 1 TO 50 'go forward | FOR counter = 1 TO 50 'go forward | ||
PULSOUT 14, 500 | PULSOUT 14, 500 | ||
Line 52: | Line 48: | ||
PAUSE 20 | PAUSE 20 | ||
NEXT | NEXT | ||
− | |||
FOR counter2 = 1 TO 100 'release | FOR counter2 = 1 TO 100 'release | ||
PULSOUT 14, 1000 | PULSOUT 14, 1000 | ||
Line 58: | Line 53: | ||
PAUSE 10 | PAUSE 10 | ||
NEXT | NEXT | ||
− | |||
FOR counter3 = 1 TO 50 'go back | FOR counter3 = 1 TO 50 'go back | ||
PULSOUT 13,900 | PULSOUT 13,900 | ||
Line 64: | Line 58: | ||
PAUSE 10 | PAUSE 10 | ||
NEXT | NEXT | ||
− | |||
FOR counter = 1 TO 3 'sound: finished! | FOR counter = 1 TO 3 'sound: finished! | ||
FREQOUT 4, 300, 4000 | FREQOUT 4, 300, 4000 | ||
PAUSE 10 | PAUSE 10 | ||
NEXT | NEXT | ||
− | |||
GOTO Finish | GOTO Finish | ||
ENDIF | ENDIF | ||
− | |||
− | |||
LOOP | LOOP | ||
− | |||
− | |||
Finish: | Finish: | ||
+ | END | ||
+ | </code> | ||
− | |||
− | |||
Picture: | Picture: |
Revision as of 10:42, 11 July 2008
The Lipstick grabber.
Very dangerous. Feared by many women. Takes away your lipstick as soon as he spots it and hides it on some other place - so far, no kidnapped lipstick has been rescued alive and there are still many missing.
Caution: Never ever let your lipstick unattended while suspicion on Lipstick grabber's presence persists.
The source code:
' {$STAMP BS2}
' {$PBASIC 2.5}
counter2 VAR Word
counter VAR Word
counter3 VAR Word
irDetectRight VAR Bit
DO
PULSOUT 14, 1000
PULSOUT 13,600 PULSOUT 12, 900
FREQOUT 2, 1, 38500 irDetectRight = IN0 IF (irDetectRight = 0) THEN
PAUSE 1000 HIGH 1 FOR counter = 1 TO 100 'take PULSOUT 14, 500 PAUSE 5 NEXT FOR counter = 1 TO 100 'go forward PULSOUT 14, 500 PULSOUT 13,650 PULSOUT 12,850 PAUSE 5 NEXT FOR counter = 1 TO 60 'turn left PULSOUT 14, 500 PULSOUT 13,650 PULSOUT 12,650 PAUSE 5 NEXT FOR counter = 1 TO 50 'go forward PULSOUT 14, 500 PULSOUT 13,650 PULSOUT 12,850 PAUSE 20 NEXT FOR counter2 = 1 TO 100 'release PULSOUT 14, 1000 LOW 1 PAUSE 10 NEXT FOR counter3 = 1 TO 50 'go back PULSOUT 13,900 PULSOUT 12, 600 PAUSE 10 NEXT FOR counter = 1 TO 3 'sound: finished! FREQOUT 4, 300, 4000 PAUSE 10 NEXT GOTO Finish
ENDIF LOOP Finish: END
Picture: <<<picture>>>
Caught on tape!!! <<<movie>>>