EmbDev.net

Forum: µC & Digital Electronics How to use PWM


von Cliff W. (cliff)


Attached files:

Rate this post
useful
not useful
I am using an Arduino Uno, Stone TFT LCD, and F5LED and I want the LED 
to get brighter and brighter as the number increases when I tap the "+" 
on the screen and conversely get dimmer and dimmer. I've tried using PWM 
but it doesn't seem to work. How do I change my code?

von MaWin (Guest)


Rate this post
useful
not useful
Cliff W. wrote:
> How do I change my code?

Delete everything, learn some basic programming techniques, start over.

PWM_DUTY is not changed, not used, and the analogWrites receive only 
values from 0..255, not 0..1023.

von Cliff W. (cliff)


Rate this post
useful
not useful
> PWM_DUTY is not changed, not used, and the analogWrites receive only
> values from 0..255, not 0..1023.

Oh yes, you reminded me with that comment.

von Sunil P. (sunil808)


Rate this post
useful
not useful
Pulse Width Modulation (PWM) is a fancy term for describing a type of 
digital signal. Pulse width modulation is used in a variety of 
applications including sophisticated control circuitry. A common way we 
use them here at SparkFun is to control dimming of RGB LEDs or to 
control the direction of a servo.

von Sunil P. (sunil808)


Rate this post
useful
not useful

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.