Skip to content

Commit e12b8f7

Browse files
authored
Change comments to explain that ESP32 has 12bit ADC (i.e. different max value needed for constructor)
1 parent 9e7ed9e commit e12b8f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MagneticSensorAnalog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** MagneticSensorAnalog(uint8_t _pinAnalog, int _min, int _max)
44
* @param _pinAnalog the pin that is reading the pwm from magnetic sensor
55
* @param _min_raw_count the smallest expected reading. Whilst you might expect it to be 0 it is often ~15. Getting this wrong results in a small click once per revolution
6-
* @param _max_raw_count the largest value read. whilst you might expect it to be 2^10 = 1023 it is often ~ 1020
6+
* @param _max_raw_count the largest value read. whilst you might expect it to be 2^10 = 1023 it is often ~ 1020. Note: For ESP32 (with 12bit ADC the value will be nearer 4096)
77
*/
88
MagneticSensorAnalog::MagneticSensorAnalog(uint8_t _pinAnalog, int _min_raw_count, int _max_raw_count){
99

@@ -106,4 +106,4 @@ int MagneticSensorAnalog::needsAbsoluteZeroSearch(){
106106
// function reading the raw counter of the magnetic sensor
107107
int MagneticSensorAnalog::getRawCount(){
108108
return analogRead(pinAnalog);
109-
}
109+
}

0 commit comments

Comments
 (0)