diff --git a/OLED/picomotodash_oled_ws10d.py b/OLED/picomotodash_oled_ws10d.py index 0aaf23a..ca405c6 100644 --- a/OLED/picomotodash_oled_ws10d.py +++ b/OLED/picomotodash_oled_ws10d.py @@ -59,8 +59,8 @@ # x_off = 28099.99 # y_off = 30178.57 # z_off = 43987.61 -headings = [] HEADING = 0 +headings = [] labels = ["N", "NE", "E", "SE", "S", "SW", "W", "NW", "N"] # Neopixel setup @@ -69,9 +69,9 @@ neopixel_ring = pdmNEOPX(pin=PIN_NUM, n=NUM_LEDS) # RPM setup -rpm_estimates = [] -RPM_ESTIMATE = 0 PWM2RPM_FACTOR = 10 +RPM_ESTIMATE = 0 +rpm_estimates = [] def read_gps(): diff --git a/OLED/picomotodash_utils.py b/OLED/picomotodash_utils.py index 512e3e4..1cf86c3 100644 --- a/OLED/picomotodash_utils.py +++ b/OLED/picomotodash_utils.py @@ -54,39 +54,3 @@ def normalise_avg(avg, headings, neopixel_ring=None): neopixel_ring.set_np(0, (0, round(map_range(np_val, (180, 0), (0, 32))), 0)) return avg - - -# def moving_avg_backup(n): -# global headings - -# if len(headings) >= n: -# headings.pop(0) - -# headings.append(HEADING) - -# # Check whether the array contains both positive and negative numbers -# has_positive = any(num > 270 for num in headings) -# has_negative = any(num < 90 for num in headings) - -# avg = sum(headings) / len(headings) - -# if avg > 180: -# np_val = 360 - avg -# else: -# np_val = avg - -# if has_positive and has_negative: -# neopixel_ring.set_np(0, (0, 0, 32)) - -# tmp_headings = [] -# for h in headings: -# if h > 270: -# h = h - 360 -# tmp_headings.append(h) -# avg = ((sum(tmp_headings) / len(tmp_headings)) + 360) % 360 - -# return avg - -# neopixel_ring.set_np(0, (0, round(map_range(np_val, (180, 0), (0, 32))), 0)) - -# return avg