1 /* Software voltage regulator using analog read and PWM
2 Connect both voltage sensor and output pin to possitive side of capacitor
3 Then connect negative side to ground
4 Voltage should be approximatelly stabilized at AREF/2
5 You can use some push-pull (totem pole) kind of buffer at output pin to supply more current
16 analogWrite(OUTPIN, map(analogRead(SENSOR), 0, 1023, 255, 0));