Added some code explanation

Comment regarding Hall sensor vs reed switch
This commit is contained in:
anatolykopyl
2019-05-30 04:20:53 +03:00
committed by GitHub
parent 1d1dbbe042
commit 44f783f763

View File

@@ -183,7 +183,10 @@ void loop() {
void update_speed() {
if (rotations > 1) {
/* Dividing dist by two because reed switch was getting triggered twice each rotation.
If you choose to go with a Hall sensor you would want to get rid of that division. */
dist = CIRCUMF * rotations / 2;
//dist = CIRCUMF * rotations;
speedKMH = dist * 3.6 / (WAIT / 1000);
} else {
speedKMH = 0;