Skip to content

Commit bfdf03b

Browse files
authored
Add files via upload
1 parent b087d8f commit bfdf03b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tm1637.c

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
const uint8_t _tm1637_digit[] =
1919
{0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f};
20+
const uint8_t _tm1637_on[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
21+
const uint8_t _tm1637_off[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
22+
const uint8_t fill_off[4] = {0x00, 0x00, 0x00, 0x00};
2023
const uint8_t _tm1637_minus = 0x40;
2124
const uint8_t _tm1637_dot = 0x80;
2225
//#######################################################################################################################
@@ -243,6 +246,16 @@ void tm1637_show_zero(tm1637_t *tm1637, bool enable)
243246
tm1637->show_zero = enable;
244247
}
245248
//#######################################################################################################################
249+
void tm1637_fill(tm1637_t *tm1637, bool enable)
250+
{
251+
if (enable)
252+
tm1637_write_segment(tm1637, _tm1637_on, 6, 0);
253+
else
254+
tm1637_write_segment(tm1637, _tm1637_off, 6, 0);
255+
}
256+
//#######################################################################################################################
257+
258+
//#######################################################################################################################
246259

247260

248261

tm1637.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
*/
1212

1313
/*
14-
* Version: 1.1.1
14+
* Version: 1.1.2
1515
*
1616
* History:
1717
*
18+
* (1.1.2): Add Fill segments
1819
* (1.1.1): Add tm1637_show_zero(), show or hide lower zero in tm1637_show_float() function.
1920
* (1.1.0): Add tm1637_write_int() and tm1637_write_float() functions.
2021
* (1.0.0): First release.
@@ -51,7 +52,7 @@ void tm1637_write_segment(tm1637_t *tm1637, const uint8_t *segments, uint8_t len
5152
void tm1637_write_int(tm1637_t *tm1637, int32_t digit, uint8_t pos);
5253
void tm1637_write_float(tm1637_t *tm1637, float digit, uint8_t floating_digit, uint8_t pos);
5354
void tm1637_show_zero(tm1637_t *tm1637, bool enable);
54-
55+
void tm1637_fill(tm1637_t *tm1637, bool enable);
5556
//####################################################################################################################
5657

5758
#ifdef __cplusplus

0 commit comments

Comments
 (0)