Go Down

Topic: LED sine wave via analog pin (Read 766 times) previous topic - next topic

I'm trying to generate a sine wave on an LED. I've found plenty of examples using PWM to generate a sine wave on a digital pin, but I need one generated via an analog pin. Any help would be greatly appreciated!

fungus


I'm trying to generate a sine wave on an LED. I've found plenty of examples using PWM to generate a sine wave on a digital pin, but I need one generated via an analog pin. Any help would be greatly appreciated!


Arduino has no analog outputs. The analog pins are input-only. PWM is the only way to do this.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Oh, well that's good to know. Sorry if that was a pretty basic question, I'm very new to all this. Thanks for the help, though!

CrossRoads

There is no analog output pin - the best you can do is fake it via a PWM pin.
Or, get an external DAC such MCP4821 or MCP4921
http://www.digikey.com/product-detail/en/MCP4921-E%2FP/MCP4921-E%2FP-ND/716280 external reference voltage
http://www.digikey.com/product-detail/en/MCP4821-E%2FP/MCP4821-E%2FP-ND/951462 internal reference voltage
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

P18F4550

6 Led's, 60 degrees out of phase, showing only the top half of the sine wave, it would'nt be hard to show the negative side using bi colour leds


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy