mirror of
https://github.com/anatolykopyl/longboard-speedometer.git
synced 2026-03-26 21:04:29 +00:00
Added some code explanation
Comment regarding Hall sensor vs reed switch
This commit is contained in:
@@ -183,7 +183,10 @@ void loop() {
|
|||||||
|
|
||||||
void update_speed() {
|
void update_speed() {
|
||||||
if (rotations > 1) {
|
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 / 2;
|
||||||
|
//dist = CIRCUMF * rotations;
|
||||||
speedKMH = dist * 3.6 / (WAIT / 1000);
|
speedKMH = dist * 3.6 / (WAIT / 1000);
|
||||||
} else {
|
} else {
|
||||||
speedKMH = 0;
|
speedKMH = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user