From 44f783f763ee0c6b4966b3df75e458952b615189 Mon Sep 17 00:00:00 2001 From: anatolykopyl <33553182+anatolykopyl@users.noreply.github.com> Date: Thu, 30 May 2019 04:20:53 +0300 Subject: [PATCH] Added some code explanation Comment regarding Hall sensor vs reed switch --- smartboard.ino | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smartboard.ino b/smartboard.ino index a955206..fee6e33 100644 --- a/smartboard.ino +++ b/smartboard.ino @@ -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;