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!
MichBFreeman:
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.
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!
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