http://captain-slow.dk/2010/10/18/volta ... d-arduino/
代碼: 選擇全部
under resistive divider
Vout = Vin*Z1/(Z1+Z2)
so for example if you wanted 0 - 12 volts scaled from 0 - 4.9 volts:
Z1 = 10,000 ohms
Z2 = 6901ohms
12v/1024 = .0117v increments
代碼: 選擇全部
under resistive divider
Vout = Vin*Z1/(Z1+Z2)
so for example if you wanted 0 - 12 volts scaled from 0 - 4.9 volts:
Z1 = 10,000 ohms
Z2 = 6901ohms
12v/1024 = .0117v increments