Solution -
To control a servo from a BASIC Stamp microcontroller is to use the PULSOUT command. This command sends a pulse of any duration you specify to an I/O pin of your choosing. The syntax of this command is
PULSOUT pin, duration
You specify the duration in units of two microseconds. A microsecond is one-millionth of a second. There are one thousand microseconds in a millisecond. Thus, to send a 1.5 ms pulse with the PULSOUT command, you must specify 750 as the duration, like this -
PULSOUT 0,750
PIN is used for the input-output like at PIN 14 we have defined to hold the servo at 45 degrees so above expression will become -
PULSOUT 14,750
Ofcouce on the change of the PIN the position will change so the answer is yes .
Get Answers For Free
Most questions answered within 1 hours.