It's called "pulse width modulation" because the Stamp, in this case, produces a stream of pulses of different widths depending what you're trying to do. The Stamp (in the Discovery Kit) has two statements that are used for this, the PULSOUT statement which produces one pulse on an I/O pin of a width specified in the statement. The PULSOUT can be repeated as needed to get a stream of pulses. This is commonly used to control servo motors where the pulse width represents a motor position or motor speed and direction. There's also a PWM statement normally used to produce voltages. The Stamp puts out a stream of random pulses that, when filtered (averaged), produce a voltage proportional to the value in the PWM statement. Read the chapters in the Stamp Manual on the PULSOUT and PWM statements for details.
Comments