EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 252

Default Icon
353 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...
PWM - BASIC Stamp Command Reference
Page 250 BASIC Stamp Programming Manual 2.0b www.parallaxinc.com
Demo Program (PWM.bs2)
' Connect a voltmeter (such as a digital multimeter set to its voltage range) to the output of
' the circuit shown in the figure for the PWM command (in the manual). Run the program
' and observe the readings on the meter. They should come very close to 1.96V, then
' decrease slightly as the capacitor discharges. Try varying the interval between PWM
' bursts (by changing the PAUSE value) and the number of PWM cycles to see their effect.
'{$STAMP BS2} 'STAMP directive (specifies a BS2)
Again:
PWM 0, 100, 40 ' 40 cycles of PWM at 100/255 duty
PAUSE 1000 ' Wait a second.
GOTO Again ' Repeat
e
2
sx
2
p
2
1
2
NOTE: This is written for the BS2
but can be used for the BS1, BS2e,
BS2sx and BS2p also. Locate the
proper source code file or modify
the STAMP directive and the
Cycles
value of PWM before downloading
to the BS1, BS2e, BS2sx or BS2p.

Table of Contents

Related product manuals