' Quick program to read a switch/pulse, blink an LED when the is pulse is seen
' and move a servo, based on state (up or down)
'
'set you pin directions input ot output 0=clap circuit 1=servo 2=led
input 0
output 1
output 2
'equates
symbol switch = pin0
symbol servo = 1
symbol led = 2
symbol state = b0
symbol pup = 210 'position to send servo to pup and pdown
symbol pdown = 105 'best down only move up timing below pretty good25ms
symbol c = b1
symbol down=0
symbol up=1
goto init
loop:
if switch = 0 then loop
if state = down then goup
init:
state=down
for c = 1 to 15
pulsout servo,pdown
high led
pause 35
low led
next
low led
pause 1000
low led
goto loop
goup:
state=up
for c = 1 to 15
pulsout servo,pup
low led
pause 35
high led
next
high led
pause 1000
high led
goto loop