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:
- 14:9018d7c592a0
- Parent:
- 13:0e7b06af9a2a
- Child:
- 15:808e98afe32b
diff -r 0e7b06af9a2a -r 9018d7c592a0 main.cpp --- a/main.cpp Mon Sep 03 01:31:17 2018 +0000 +++ b/main.cpp Mon Sep 03 08:03:47 2018 -0700 @@ -68,6 +68,7 @@ // us which direction the wheel is moving (right or left) so that we can // use it to select the current mode. QEI Wheel(D12, D11, NC, 16); // Quadrature encoder +int WheelCurrentState = 0; int WheelCurrent = 0; int WheelPrevious = 0; @@ -162,7 +163,7 @@ seconds = time(NULL); // get current time strftime(Text, 50, "%H:%M:%S", localtime(&seconds)); PC.printf(" RTC: %s, CNT1: %7d CNT2: %7d",Text, Count1, Count2); - PC.printf(" wheel %d", WheelCurrent); + PC.printf(" wheel %d %d", WheelCurrent, WheelCurrentState); } void Update() @@ -223,7 +224,8 @@ gate--; } - WheelCurrent = int(Wheel.getPulses()); + WheelCurrent = int(Wheel.getPulses()); + WheelCurrentState = int(Wheel.getCurrentState()); if (WheelCurrent > WheelPrevious) LED_status_index = ++LED_status_index % sizeof(LED_statuses); else