Charles Young's development fork. Going forward I only want to push mature code to main repository.
Fork of GEO_COUNTER_L432KC by
Diff: main.cpp
- Revision:
- 13:0e7b06af9a2a
- Parent:
- 12:258fc423e0fd
- Child:
- 14:9018d7c592a0
--- a/main.cpp Sun Sep 02 18:19:17 2018 -0700 +++ b/main.cpp Mon Sep 03 01:31:17 2018 +0000 @@ -38,7 +38,7 @@ #define CNT2 0x20 #define HV 0x40 #define MENU 0x80 -uint8_t LED_statuses [CPM, CPS, PLS, VOLTS, CNT1, CNT2, HV, MENU]; +uint8_t LED_statuses[] = {CPM, CPS, PLS, VOLTS, CNT1, CNT2, HV, MENU}; uint8_t LED_status = CPM; uint8_t LED_status_index = 0; @@ -116,7 +116,7 @@ CS1 = 1; // presets CS of MAX7219 CS2 = 1; // preset CS of 74HC595 - Display_6D_write(543210); + Display_6D_write(0x543210); Display_2D_write(TGATE); Display_init(); // initialize MAX7219 @@ -135,7 +135,7 @@ // set the 1 sec ticker to periodically call the Update() routine // NOTE: this is also the 1-sec time base for counters. A better approach // would replace the ticker with an interrupt from the RTC (to be implemented) - Sec_Beat.attach_us(&Update, 1000000); + Sec_Beat.attach_us(&Update, 100000); //RTC::attach(&Update, RTC::Second); //RTC::detach(RTC::Second); @@ -225,10 +225,10 @@ WheelCurrent = int(Wheel.getPulses()); if (WheelCurrent > WheelPrevious) - LED_status_index++ | sizeof(LED_statuses); + LED_status_index = ++LED_status_index % sizeof(LED_statuses); else if (WheelCurrent < WheelPrevious) - LED_status_index-- | sizeof(LED_statuses); + LED_status_index = --LED_status_index % sizeof(LED_statuses); WheelPrevious = WheelCurrent; logToPC();