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.
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...