2011_Activity #4b - Controlling a servo with a potentiometer(using constraints)

2011_Activity#4b- - CON 14 s time VAR Word t DO HIGH rcPin PAUSE delay RCTIME rcPin 1 time time = time scaleFactor SclaeFactoe time = time offset

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

View Full Document Right Arrow Icon
' What's a Microcontroller - ControlServoWithPotUsingConstrants.bs2 ' Read potentiometer in RC-time circuit using RCTIME command. ' Apply scale factor and offset, then send value to servo. ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' scaleFactor CON 185 offset CON 500 rcPin CON 7 delay CON 10 servoPin
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CON 14 s time VAR Word t DO HIGH rcPin PAUSE delay RCTIME rcPin, 1, time time = time */ scaleFactor ' SclaeFactoe. time = time + offset ' Offset by offset. PULSOUT servoPin, time ' Send pulse to servo. DEBUG HOME, DEC5 time ' Display adjusted time value. 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