Similar contentNavigationUser loginTags in Vokabular |
Test of PWM on ArduinoOne of the easiest way of testing PWM (Pulse Width Modulation) for regulating power on electric motors, such as fans, is to attach a standard LED to the Arduino. Put the short pin of the LED into the socket marked PWN 13 on the digital side of the board, and the other pin into the socket marked GND. Run the following little program (called a Sketch) on the Arduino. // PWM test using a LED // connected between one of the PWM pins // - and ground - use the short pin to ground int ledvalue = 0; // variable to keep the pwn duty cycle value int ledpin = 9; // light connected to pwm pin int stepsize = 1; // how many steps to increase the duty cycle with per stepdelay int stepdelay = 20; // The delay (millisecs) between increases/decreases in duty cycle int ledmin = 10; // minimum value for duty cycle int ledmax = 255; // maximum value for duty cycle |
Buzzworthy
Search |
Comments
Post new comment