By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 2,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

how can you do an analog write to a digital output

P: n/a
I am working with an Arduino board that uses C programming. I tried to program an analog fade program to an LED on an analog just flashed. I then used analog programming code and sent it to a digital pin. Why does this work???
Nov 18 '10 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 2,400
What do you mean by "analog programming code"?

Are you trying to adjust the brightness of an LED? An LED is basically either on or off, it doesn't support different brightness levels. It is customary to accomplish the appearance of adjustable brightness through pulse-width modulation (PWM). That is, the LED is turned on and off at a sufficiently high frequency that the human eye doesn't perceive the flicker. The apparent brightness of the LED can be adjusted by varying the duty cycle of the PWM signal. Notice that PWM can be accomplished with a digital output.
Nov 18 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.