Skip to content

Commit a7dca93

Browse files
committed
Corrected a bad bug. Tested with new SevSeg library.
I moved commandMode variable into the updateBufferData because I didn't think it was used anywhere else. The variable is not used anywhere else, but the function depends on the command being stored towards the end of the function. Summary: commandMode needs to be global. This fixes my mistake.
1 parent 9272fd6 commit a7dca93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firmware/Serial 7-Segment Display/Serial_7_Segment_Display_Firmware/Serial_7_Segment_Display_Firmware.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ SevSeg myDisplay; //Create an instance of the object
4141
unsigned int analogValue6 = 0; //These are used in analog meter mode
4242
unsigned int analogValue7 = 0;
4343
char deviceMode; //This variable is useds to select which mode the device should be in
44+
unsigned char commandMode = 0; // Used to indicate if a commandMode byte has been received
4445

4546
// Struct for circular data buffer data received over UART, SPI and I2C are all sent into a single buffer
4647
struct dataBuffer
@@ -232,7 +233,6 @@ void displayAnalog()
232233
// will be executed from this function.
233234
void updateBufferData()
234235
{
235-
unsigned char commandMode = 0; // Used to indicate if a commandMode byte has been received
236236

237237
// First we read from the oldest data in the buffer
238238
unsigned char c = buffer.data[buffer.tail];

0 commit comments

Comments
 (0)