2011_Activity #4 - Pushbutton Controlled Servo

2011_Activity #4 - Pushbutton Controlled Servo - d DO D IF...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
' What's a Microcontroller - ServoControllerWithPushbuttons.bs2 ' Press and hold P4 pushbutton to rotate the servo counterclockwise, ' or press the pushbutton connected to P3 to rotate the servo clockwise ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' duration VAR Word d duration = 750
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d DO D IF IN3 = 1 THEN IF duration > 500 THEN duration = duration - 25 ENDIF ENDIF IF IN4 = 1 THEN IF duration < 1000 THEN duration = duration + 25 ENDIF ENDIF PULSOUT 14, duration PAUSE 10 DEBUG HOME, DEC4 duration, " = duration" LOOP...
View Full Document

This note was uploaded on 01/10/2011 for the course EE 1244 taught by Professor Drera during the Fall '10 term at Conestoga.

Ask a homework question - tutors are online