Skip to content

Commit cb99187

Browse files
committed
Merge branch 'dev' of github.com:askuric/Arduino-FOC into dev
2 parents ae934b7 + 320f473 commit cb99187

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/utils/sensor_test/magnetic_sensors/magnetic_sensor_analog_example/magnetic_sensor_analog_example.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* MagneticSensorAnalog(uint8_t _pinAnalog, int _min, int _max)
99
* - pinAnalog - the pin that is reading the pwm from magnetic sensor
1010
* - 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
11-
* - max_raw_count - the largest value read. whilst you might expect it to be 2^10 = 1023 it is often ~ 1020
11+
* - max_raw_count - the largest value read. whilst you might expect it to be 2^10 = 1023 it is often ~ 1020. Note ESP32 will be closer to 4096 with its 12bit ADC
1212
*/
1313
MagneticSensorAnalog sensor = MagneticSensorAnalog(A1, 14, 1020);
1414

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)