2011_Activity #4a - Controlling a servo with a potentiometer

2011_Activity #4a - Controlling a servo with a...

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

View Full Document Right Arrow Icon
' What"s a Microcontroller - ControlServoWithPot.bs2 ' Read potentiometer in RC-time circuit using RCTIME command ' Scale time by 0.724 and offset by 500 for the servo ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' DEBUG "Program Running!"
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 time VAR Word t DO HIGH 7 PAUSE 10 RCTIME 7, 1, time time = time */ 185 'Scale by 0.724 (X 256 fpr */) time = time + 500 'Offset by 500. PULSOUT 14, time 'Send pulse to servo LOOP...
View Full Document

Ask a homework question - tutors are online