Read duty cycle of a pwm pin on Arduino Mega... ?!

I don't get why saving a variable is such a big deal.

Oh, come on, don't take it so seriously, i don't think saving variables is such a big deal :slight_smile:
I just generally try to make my programms as efficient as possible (i think i'm not very good at that though :)) and i thought if there would be something like digitalRead() except for reading the pwm duty cycle, i could have used that instead of having to save all the values in variables (although, i was already woundering, if assuming that would be possible, it wouldn't take alot more time to read the duty cycles instead of reading them from the variables).

The value was in a variable when you did the analogWrite, so why not use that again?

The problem is, the variables that are used for the analogWrite, are the parameters passed to the function, and they get overwritten each time the function is called... But never mind, i'll just save them to variables, i just wanted to ask, i mean it could have been as easy as digitalRead, who knows...

Thanks for all the replys...

Delphiño