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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig