' {$STAMP BS2} press VAR Nib main: 'Main instructions IF IN0 = 1 THEN light '~~~if the button is pressed, go to the first part of instructions IF IN1 = 1 THEN reset '~~~if the reset button is pressed it will execute the response for that GOTO main light: '~~~telling the chip to get the value of step after button being pressed BRANCH Press, [one, two, three, four, five, six, seven, eight, nine, ten] reset: '~~~telling what to do if the stop button is pressed IF press = 10 THEN flapup IF press < 10 THEN noflapup one: '~~~these tell the chip how many lights to light up press = 1 HIGH 2 DEBUG BIN16 press,CR PAUSE 2000 GOTO main two: press = 2 HIGH 2 HIGH 3 DEBUG BIN16 press,CR PAUSE 2000 GOTO main three: press = 3 HIGH 2 HIGH 3 HIGH 4 DEBUG BIN16 press,CR PAUSE 2000 GOTO main four: press = 4 HIGH 2 HIGH 3 HIGH 4 HIGH 5 DEBUG BIN16 press,CR PAUSE 2000 GOTO main five: press = 5 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 DEBUG BIN16 press,CR PAUSE 2000 GOTO main six: press = 6 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 HIGH 7 DEBUG BIN16 press,CR PAUSE 2000 GOTO main seven: press = 7 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 HIGH 7 HIGH 8 DEBUG BIN16 press,CR PAUSE 2000 GOTO main eight: press = 8 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 HIGH 7 HIGH 8 HIGH 9 DEBUG BIN16 press,CR PAUSE 2000 GOTO main nine: press = 9 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 HIGH 7 HIGH 8 HIGH 9 HIGH 10 DEBUG BIN16 press,CR PAUSE 2000 GOTO main ten: press = 10 HIGH 2 HIGH 3 HIGH 4 HIGH 5 HIGH 6 HIGH 7 HIGH 8 HIGH 9 HIGH 10 HIGH 11 PAUSE 250 LOW 11 DEBUG BIN16 press,CR PAUSE 2000 GOTO main flapup: '~~~this coding tells the system to start the motor to return press = 0 'the flap as well as reset the LEDs and 'press'. LOW 2 LOW 3 LOW 4 LOW 5 LOW 6 LOW 7 LOW 8 LOW 9 LOW 10 HIGH 11 PAUSE 250 LOW 11 DEBUG BIN16 press,CR PAUSE 1000 GOTO main noflapup: '~~~this coding makes sure not to drop the flap if someone should press press = 0 'reset prior to the circuit completing a full loop LOW 2 LOW 3 LOW 4 LOW 5 LOW 6 LOW 7 LOW 8 LOW 9 LOW 10 LOW 11 DEBUG BIN16 press,CR PAUSE 1000 GOTO main