Injecting a signal into the analog inputs

Is it possible to inject a sine wave or other wave form in to the Arduino Uno Rev3 analog inputs?

If so, can someone that has experience with this idea please share a Sketch that they may have.

I have a scope and want to see what the results would be on outputs from the Arduino.

This may seem crazy but, I want to experiment....

I am a newbie and need some ideas.

Thank you for any reply...


No reason why not, it's just a voltage after all. Hook your source up to the pin, common ground, not over 5V though.

Then in your sketch, do an analogRead() in loop(). That will give you a value from 0-1023. Then use map() (or just divide by 4) to give a value from 0-255 to send out again on a PWM pin with analogWrite().

It's this example but with your sine wave in not a pot, really.