Assert for missing feature
[mirrors/Programs.git] / arduino / Regulator / Regulator.ino
CommitLineData
a9277e75
TM
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
6*/
7
8
9#define SENSOR A0
10#define OUTPIN 11
11
12void setup() {
13}
14
15void loop() {
16 analogWrite(OUTPIN, map(analogRead(SENSOR), 0, 1023, 255, 0));
17}
18
19
This page took 0.138308 seconds and 4 git commands to generate.