EasyManua.ls Logo

Parallax BASIC Stamp II - Pwm

Default Icon
68 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC Stamp II Manual 0.94 • Parallax, Inc. • (916) 624-8333 • Page 49
BASIC Stamp II
PWM
Pulse-width modulate a pin for some time.
usage: PWM pin,duty,cycles
Pin will be temporarily made an output while it is modulated.
Duty is an 8-bit value (0-255) which specifies the duty-cycle.
Cycles is the number of 256 pin update periods which take ~1ms. When
done, pin will be placed in input mode to allow the voltage to remain
until another PWM is executed.
A digital-to-analog converter can be made by connecting the pin to a
resistor which goes to a cap which goes to GND. The resistor-cap junc-
tion will reflect the duty (0-5V) during and after PWM (see below).