Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of GEO_COUNTER_L432KC by
Diff: main.cpp
- Revision:
- 44:a26ca542ae5e
- Parent:
- 41:08bf3ea5eba4
- Child:
- 45:b9e1b3d4a752
--- a/main.cpp Thu Sep 06 10:59:42 2018 -0700
+++ b/main.cpp Thu Sep 06 11:44:05 2018 -0700
@@ -54,7 +54,12 @@
// Global variables
time_t seconds; // Real-Time Clock (RTC) timestamp
unsigned int value = 0; // displayed value on the 6-digits of the display
+
uint32_t Count1, Count2; // pulse counters (32-bit)
+int16_t TickerCorrection = 0;
+const int16_t TickerCorrectionMax = 99;
+const int16_t TickerCorrectionMin = -99;
+
char Text[40]=""; // used to send messages over the serial port
uint8_t Disp_mode = 0x01, Disp_unit = 0xA0; // status of 1st row and 2nd rows of LEDs
bool Stopped = 0; // status of counting activity
@@ -150,7 +155,10 @@
DigitsDisplay.Display_2D_Blank();
break;
case PROSPECT:
- DigitsDisplay.Display_6D_write(Count1);
+ if (Count1)
+ DigitsDisplay.Display_6D_write(Count1);
+ else
+ DigitsDisplay.Display_6D_write(Count2);
DigitsDisplay.Display_2D_Blank();
break;
case NULL1:
@@ -197,6 +205,23 @@
switch (currentMode) {
case CNT1:
case CNT2:
+ currentModeToDisplay = currentMode;
+
+ if ( (direction > 0)
+ && (TickerCorrection < TickerCorrectionMax))
+ {
+ TickerCorrection++;
+ Sec_Beat.attach_us(&UpdateOutput, 1000000 + TickerCorrection);
+ }
+ else
+ if ( (direction < 0)
+ && (TickerCorrection > TickerCorrectionMin))
+ {
+ TickerCorrection--;
+ Sec_Beat.attach_us(&UpdateOutput, 1000000 + TickerCorrection);
+ }
+ DigitsDisplay.Display_2D_write(volume);
+ break;
case PROSPECT:
case VOLTS:
currentModeToDisplay = currentMode;
