removed leading zeros from sevensegmen
This commit is contained in:
parent
a64bc39662
commit
6cd04b244a
|
@ -90,13 +90,26 @@ static void print_sevenseg(uint8_t display, uint16_t value) {
|
|||
d[0] = (value % 10);
|
||||
|
||||
if(display == 0) {
|
||||
for(uint8_t i = 0; i< 3; i++) {
|
||||
digitbuffer[i] = segment_translate[d[i]];
|
||||
}
|
||||
digitbuffer[0] = segment_translate[d[0]];
|
||||
if(d[1] == 0)
|
||||
digitbuffer[1] = 0x00;
|
||||
else
|
||||
digitbuffer[1] = segment_translate[d[1]];
|
||||
if(d[2] == 0)
|
||||
digitbuffer[2] = 0x00;
|
||||
else
|
||||
digitbuffer[2] = segment_translate[d[2]];
|
||||
} else {
|
||||
for(uint8_t i = 0; i< 3; i++) {
|
||||
digitbuffer[i+3] = segment_translate[d[i]];
|
||||
}
|
||||
digitbuffer[3] = segment_translate[d[0]];
|
||||
if(d[1] == 0)
|
||||
digitbuffer[4] = 0x00;
|
||||
else
|
||||
digitbuffer[4] = segment_translate[d[1]];
|
||||
if(d[2] == 0)
|
||||
digitbuffer[5] = 0x00;
|
||||
else
|
||||
digitbuffer[5] = segment_translate[d[2]];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue