Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 5
    That's just a math problem, and a simple one at that. Read your voltage, calculate the PWM to get the average you want, then apply that PWM. What part is sticking you? Commented Sep 18, 2020 at 4:50
  • That would work. Just note that the 1.1V reference can differ slightly, from chip to chip. So depending on your margin of error, you might have to do a bit of calibration. PS it sound like you already know, but just to reiterate; PWM output doesn't give out an analog voltage, despite the misleading analogWrite function name. You'd have to do some filtering to convert the PWM to a analog voltage. Commented Sep 18, 2020 at 14:08
  • Wouldn't a voltage regulator do that better than an Arduino? Commented Sep 18, 2020 at 17:37