130-28176 Parallax Inc, 130-28176 Datasheet - Page 158

KIT PARTS PROCESS CONTROL

130-28176

Manufacturer Part Number
130-28176
Description
KIT PARTS PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 130-28176

Accessory Type
Education Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Board of Education Full Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Using the PWM Instruction
A much more efficient means to produce a clean PWM drive is through the use of the
PWM
PWM Pin, Duty, Cycles
The
of 255 corresponds to a duty cycle of 100%. So, for a 50% duty cycle,
halfway between 0 and 255. The
BASIC Stamp 2,
instruction. Here is the syntax:
Duty
Save PwmTest.bs2 under the name PwmCommand.bs2.
Replace the
Apply_Drive:
RETURN
Download the program and repeat the PWM test.
argument can be 0-255. A
The BASIC Stamp works in integer math. That is, values with decimal places will be
truncated, or have the decimal portion dropped. Also, any intermediary math calculation
cannot exceed 65,535.
My BASIC Stamp is resetting! If it appears that your BASIC Stamp is
resetting, you might try placing a 10 µF capacitor across the Vin and Vss
terminals of your Board of Education, but BE VERY CAREFUL!
WARNING: Always observe polarity when connecting an electrolytic
capacitor – reversing the leads can cause it to explode. Safety
goggles are recommended.
FOR X = 0 TO 15
NEXT
PWM Fan, Duty * 255 / 100, 100
Cycles
Disconnect the power before adding the capacitor to the board.
Connect the positive terminal to Vin and the negative terminal
to Vss.
Remember, the negative terminal is the lead that comes out of
the metal canister closest to the stripe with a negative (–) sign.
Double-check your circuit before reconnecting power.
Apply_Drive
specifies the duration of the PWM signal in 1 millisecond units.
Cycles
subroutine with the following:
Duty
of 0 corresponds to a 0% duty cycle, and a
argument can also be 0-255. When using the
Duty
would be
-
10 µF
Duty
+

Related parts for 130-28176