Complete noob here. I've just received an Arduino Uno R3 as a gift and I've managed to get the IDE running, and to flash and dim an LED. (Woohoo!)
But now I'd like to throb the LED with a sine wave. When I've done this in other languages, I accessed the system time (x) and calculated the appropriate brightness level (y) from that time. How can I do that with the Arduino? Is there an on-board clock or timer that can be accessed? I could increment a counter that advances with each loop iteration and use that as a proxy for time, but it's kludgy and not exactly the same.
But now I'd like to throb the LED with a sine wave. When I've done this in other languages, I accessed the system time (x) and calculated the appropriate brightness level (y) from that time. How can I do that with the Arduino? Is there an on-board clock or timer that can be accessed? I could increment a counter that advances with each loop iteration and use that as a proxy for time, but it's kludgy and not exactly the same.