Skip to content

Commit 4e79022

Browse files
add 12-bit analogReadResolution
1 parent c142a91 commit 4e79022

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

examples/SimpleCalibration/SimpleCalibration.ino

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
* Analog Correction For Raspberry Pi Pico
33
* https://github.com/Phoenix1747/Arduino-Pico-Analog-Correction
4-
*
4+
*
55
* Connect A1 to GND and A0 to VCC (3.3V), then
66
* upload this sketch and restart the Pico.
77
* The connections should be as short as possible!
88
* Your calibration values will be printed to the
9-
* Serial Monitor. Paste them into the
9+
* Serial Monitor. Paste them into the
1010
* PicoAnalogCorrection constructor and you're done.
11-
*
11+
*
1212
* MIT, 2021, Phoenix1747
1313
*/
1414

@@ -23,6 +23,8 @@ void setup() {
2323
pinMode(GND_PIN, INPUT);
2424
pinMode(VCC_PIN, INPUT);
2525

26+
analogReadResolution(12); // 12-bit ADC, 4096 channels
27+
2628
// Calibrate ADC using an average of 5000 measurements
2729
pico.calibrateAdc(GND_PIN, VCC_PIN, 5000);
2830

@@ -39,18 +41,18 @@ void setup1() {
3941
void loop() {
4042
Serial.print("Offset Values: ");
4143
pico.returnCalibrationValues();
42-
44+
4345
Serial.print("Uncalibrated GND: ");
4446
Serial.println(pico.analogRead(GND_PIN));
4547
Serial.print("Calibrated GND: ");
4648
Serial.println(pico.analogCRead(GND_PIN,10));
47-
49+
4850
Serial.print("Uncalibrated VCC: ");
4951
Serial.println(pico.analogRead(VCC_PIN));
5052
Serial.print("Calibrated VCC: ");
5153
Serial.println(pico.analogCRead(VCC_PIN,10));
5254
Serial.println();
53-
55+
5456
delay(1000);
5557
}
5658

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=PicoAnalogCorrection
2-
version=1.1.2
2+
version=1.1.3
33
author=Phoenix1747
44
maintainer=Phoenix1747
55
sentence=Arduino library to calibrate and improve ADC measurements with the Raspberry Pi Pico.

0 commit comments

Comments
 (0)