DeanIsMe/SevSeg

Activate all decimals at once

Closed this issue · 1 comments

I have a 4 segment display and I am making a countdown timer. I would like to flash all of the decimal dots to show as a visual warning that there is less than 30 seconds left. Here is what I currently have.

uint8_t segs;
sevseg.getSegments(&segs);
segs = segs ^ 0b10000000;
sevseg.setSegments(&segs);

This works great for setting one segment at a time but I need to flash all 4 at the same time. Is there a way to do this?

This code would be corrupting your stack and resulting in undefined behaviour. The signature for getSegments is
void SevSeg::getSegments(uint8_t segs[])
It requires an array pointer.

Change your first line to
uint8_t segs[4];