From b5a87134c129984b7570ba4cd1612cf81afaf350 Mon Sep 17 00:00:00 2001 From: chaduhduh Date: Wed, 28 Feb 2024 21:28:33 -0700 Subject: [PATCH] updates firmware to support SegSev 3.7.0 This old firmware is designed to be used with a separately maintained and released fork of SegSev and the APIs now appear to differ. These updates address this by updating various calls to the new API and making the necessary refresh calls. This change is probably useful for others since folks using library managers will likely end up with the other version. Note that this has only been tested on the S7S board layout. Open segment and 7 segment shield were updated but are untested. --- .../Serial_7_Segment_Display_Firmware.ino | 19 ++-- .../System_Functions.ino | 98 +++++++++++++++---- 2 files changed, 92 insertions(+), 25 deletions(-) diff --git a/firmware/Serial 7-Segment Display/Serial_7_Segment_Display_Firmware/Serial_7_Segment_Display_Firmware.ino b/firmware/Serial 7-Segment Display/Serial_7_Segment_Display_Firmware/Serial_7_Segment_Display_Firmware.ino index a327e65..593038e 100644 --- a/firmware/Serial 7-Segment Display/Serial_7_Segment_Display_Firmware/Serial_7_Segment_Display_Firmware.ino +++ b/firmware/Serial 7-Segment Display/Serial_7_Segment_Display_Firmware/Serial_7_Segment_Display_Firmware.ino @@ -111,7 +111,8 @@ void displayData() while(deviceMode == MODE_DATA) { //Just hang out and update the display as new data comes in - myDisplay.DisplayString(display.digits, display.decimals); //(numberToDisplay, decimal point location) + myDisplay.setNumber(display.digits, display.decimals); //(numberToDisplay, decimal point location) + myDisplay.refreshDisplay(); serialEvent(); //Check the serial buffer for new data } @@ -138,7 +139,8 @@ void displayCounter() if(digitalRead(counterIncrement) == LOW) { delay(1); //Check the pin 1 ms later - this is for debounce - myDisplay.DisplayString(display.digits, 0); //Update display so that it doesn't blink + myDisplay.setNumber(display.digits, 0); //Update display so that it doesn't blink + myDisplay.refreshDisplay(); if(digitalRead(counterIncrement) == LOW) { @@ -159,8 +161,9 @@ void displayCounter() if(digitalRead(counterDecrement) == LOW) { delay(1); //Check the pin 1 ms later - this is for debounce - myDisplay.DisplayString(display.digits, 0); //Update display so that it doesn't blink - + myDisplay.setNumber(display.digits, 0); //Update display so that it doesn't blink + myDisplay.refreshDisplay(); + if(digitalRead(counterDecrement) == LOW) { if(decrementCounted == false) //Only increment counter if this is a new pulse @@ -188,7 +191,8 @@ void displayCounter() // tempCounter /= 10; //Shave number down by one digit // } - myDisplay.DisplayString(display.digits, 0); //(numberToDisplay, no decimals during counter mode) + myDisplay.setNumber(display.digits, 0); //(numberToDisplay, no decimals during counter mode) + myDisplay.refreshDisplay(); serialEvent(); //Check the serial buffer for new data } @@ -220,7 +224,8 @@ void displayAnalog() display.digits[3] = voltage7 % 10; display.decimals = ((1<