abc Arduino
|
Board | Operating voltage | Usable pins | Max resolution |
---|---|---|---|
Uno | 5 Volts | A0 to A5 | 10 bits |
Mini, Nano | 5 Volts | A0 to A7 | 10 bits |
Mega, Mega2560, MegaADK | 5 Volts | A0 to A14 | 10 bits |
Micro | 5 Volts | A0 to A11* | 10 bits |
Leonardo | 5 Volts | A0 to A11* | 10 bits |
Zero | 3.3 Volts | A0 to A5 | 12 bits** |
Due | 3.3 Volts | A0 to A11 | 12 bits** |
MKR Family boards | 3.3 Volts | A0 to A6 | 12 bits** |
Pretvaranje očitane vreidjnsoti (0 - 1023) u volte od 0 - 5 izvodi se izrazom:
float aVolt = aUlaz * (5.0 / 1023.0);
Šema povezivanja: |
Elementi: |
|
Listing programa : void setup() { Serial.begin(9600); } void loop() { int sensorValue = analogRead(A0); float voltage = sensorValue * (5.0 / 1023.0); Serial.println(voltage); delay(500); } |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |