Skip to content

Commit dda98e5

Browse files
authored
Merge pull request #620 from per1234/improve-SAMD_AnalogCorrection-docs
Document SAMD_AnalogCorrection library's 12 bit resolution requirement
2 parents a38aba7 + 7f72619 commit dda98e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
6) Open the Serial Monitor and press the reset button on the Arduino ZERO
1919
7) At the and of the procedure you can find logged
2020
- the offset and gain values for the board where the sketch has been just executed
21-
- the instruction line to copy/paste in the final sketch
21+
- the code to copy/paste in sketches using this library
2222
*/
2323

2424
#include "SAMD_AnalogCorrection.h"
@@ -32,7 +32,7 @@
3232
#define ADC_MIN_GAIN 0x0400
3333
#define ADC_UNITY_GAIN 0x0800
3434
#define ADC_MAX_GAIN (0x1000 - 1)
35-
#define ADC_RESOLUTION_BITS 12
35+
#define ADC_RESOLUTION_BITS 12 // do not change. This library only supports 12 bit resolution.
3636
#define ADC_RANGE (1 << ADC_RESOLUTION_BITS)
3737
#define ADC_TOP_VALUE (ADC_RANGE - 1)
3838

@@ -162,7 +162,8 @@ void setup()
162162
Serial.println(offsetCorrectionValue);
163163
Serial.print(" Gain = ");
164164
Serial.println(gainCorrectionValue);
165-
Serial.println("\r\nAdd the next line to your sketch:");
165+
Serial.println("\r\nAdd the next lines to your sketch:");
166+
Serial.println(" analogReadResolution(12);");
166167
Serial.print(" analogReadCorrection(");
167168
Serial.print(offsetCorrectionValue);
168169
Serial.print(", ");

0 commit comments

Comments
 (0)