@@ -25,7 +25,7 @@ it is faster for writing on average. The actual gain depends on the
2525application and of course the values.
2626
2727
28- #### 0.4.0 Breaking change
28+ ### 0.4.0 Breaking change
2929
3030Version 0.4.0 introduced a breaking change.
3131You cannot set the pins in ** begin()** any more.
@@ -65,27 +65,47 @@ With dual display it is important to **setDigits()** for the displays correctly
6565get leading/trailing zero's correctly.
6666
6767
68+ ### I2C multiplexing
69+
70+ Sometimes you need to control more devices than possible with the default
71+ address range the device provides.
72+ This is possible with an I2C multiplexer e.g. TCA9548 which creates up
73+ to eight channels (think of it as I2C subnets) which can use the complete
74+ address range of the device.
75+
76+ Drawback of using a multiplexer is that it takes more administration in
77+ your code e.g. which device is on which channel.
78+ This will slow down the access, which must be taken into account when
79+ deciding which devices are on which channel.
80+ Also note that switching between channels will slow down other devices
81+ too if they are behind the multiplexer.
82+
83+ - https://github.com/RobTillaart/TCA9548
84+
85+
6886## Interface
6987
7088``` cpp
7189#include " HT16K33.h"
7290```
7391
74- #### Setup behaviour
92+ ### Constructor
7593
76- - ** HT16K33(const uint8_t address)** address is 0x70..0x77 depending on the jumpers A0..A2. ** 0x70** is default.
94+ - ** HT16K33(const uint8_t address, TwoWire \* wire = \& Wire)** address is 0x70..0x77 depending on the jumpers A0..A2. ** 0x70** is default.
95+ Optional set the I2C bus.
7796- ** bool begin()** initialize library and calls ** reset()** .
7897Returns false if address not seen on I2C bus.
7998- ** bool isConnected()** Returns false if address not seen on I2C bus.
99+ - ** uint8_t getAddress()** returns address set in constructor.
80100- ** void reset()** resets display.
81101
82- #### Cache
102+ ### Cache
83103
84104- ** void clearCache()** forced clearing of the cache, to be used to switch the cache off just for one write.
85105- ** void cacheOn()** enable caching, this is default behaviour.
86106- ** void cacheOff()** disable caching, will force writing to every position.
87107
88- #### Display
108+ ### Display
89109
90110- ** void displayOn()** enable display.
91111- ** void displayOff()** disable display, fast way to darken display e.g. for energy consumption.
@@ -95,7 +115,7 @@ Returns false if address not seen on I2C bus.
95115- ** void getBlink(uint8_t value)** values 0..3 0 = off.
96116- ** void setDigits(uint8_t value)** values 0..4, minimal number of digits shown, mandatory for large numbers on dual display.
97117
98- #### Data types
118+ ### Data types
99119
100120The bool return value indicates that the value displayed is in range.
101121
@@ -120,19 +140,19 @@ The unitChar is a postFix character like C or F for temperature H for humidity.
120140The unitChar must be one of the chars supported like HT16K33_C, HT16K33_TOP_C or HT16K33_DEGREE (see below).
121141So ** displayUnit(25.6, 1, HT16K33_DEGREE)** will display ** 23.5°** .
122142
123- #### Fixed point
143+ ### Fixed point
124144
125145- ** bool displayFixedPoint0(float f)** displays values -999 .. 9999 without decimals.
126146- ** bool displayFixedPoint1(float f)** displays values -99.9 .. 999.9 with 1 decimals.
127147- ** bool displayFixedPoint2(float f)** displays values -9.99 .. 99.99 with 2 decimals.
128148- ** bool displayFixedPoint3(float f)** displays values 0.000 .. 9.999 with 3 decimals.
129149
130- #### Special VU meters
150+ ### Special VU meters
131151
132152- ** bool displayVULeft(uint8_t value)** display used as sort VU meter, values 0..8 Vales > 8 are treated as 8 (but return false).
133153- ** bool displayVURight(uint8_t value)** display used as sort VU meter, values 0..8 Vales > 8 are treated as 8 (but return false).
134154
135- #### Lower level workers
155+ ### Lower level workers
136156
137157- ** void display(uint8_t \* array)** array of 4 bytes to control one 7seg display.
138158- ** void display(uint8_t \* array, uint8_t point)** idem + point = position of the digit with point (0..3).
@@ -146,10 +166,10 @@ one can use the individual segments SEG_A..SEG_G and SEG_DP.
146166
147167![ layout] ( https://upload.wikimedia.org/wikipedia/commons/0/02/7_segment_display_labeled.svg " ") .
148168
149- _ Image courtesey wikimedia_
169+ _ Image courtesy wikimedia_
150170
151171
152- #### Extra LEDs table
172+ ### Extra LEDs table
153173
154174| mask | description |
155175| :------:| :--------------|
@@ -162,16 +182,16 @@ _Image courtesey wikimedia_
162182( based upon issue #21 )
163183
164184
165- #### Debugging
185+ ### Debugging
166186
167187- ** void displayTest(uint8_t del)** debugging / test function.
168188- ** void dumpSerial(uint8_t \* array, uint8_t point)** debugging equivalent of the display.
169189Prints to Serial.
170190- ** void dumpSerial()** print HEX codes equivalent of the display to Serial.
171- - ** uint8_t getAddress()** idem.
172191
173192
174- #### Obsolete soon
193+
194+ ### Obsolete soon
175195
176196- brightness() use setBrightness()
177197- blink() use setBlink()
@@ -202,6 +222,9 @@ from .h file, elaborate
202222#define HT16K33_MINUS 17
203223#define HT16K33_TOP_C 18 // c
204224#define HT16K33_DEGREE 19 // °
225+ #define HT16K33_P 20
226+ #define HT16K33_J 21
227+ #define HT16K33_H 22
205228#define HT16K33_NONE 99
206229```
207230
@@ -231,16 +254,16 @@ Mainly for a 0.4.x
231254- VU metering using halve bars allows two VU from 0..8 ** new**
232255- VU metering using halve bars allows one VU from 0..17. extension of current VUleft/right
233256- optimize math if possible - performance and footprint. + float + int division
234- - low level I2C error detection
257+ - error handling
258+ - low level I2C error detection
259+ - ** int getLastError()**
235260- write single position - ** writePos(uint8_t pos, uint8_t mask)**
261+ - add example car battery monitor (e.g. voltage divider & analogRead)
262+ - 00.0 - 13.6 Volt (or even up to 99.9V)
263+ - leaves one position for (_ = OK, A = Alarm, E = error, F = Fail)
264+ - need a write single position
236265 - [ status] dd.d
237- - add examples
238- - car battery monitor (voltage divider & analogRead)
239- - add more "special chars"?
240- - #define HT16K33_P Pascal / Pressure 0x73
241- - #define HT16K33_J joule 0x0E
242- - #define HT16K33_H humidity 0x76
243-
266+ - ** displayVoltage(float volts, uint8_t status, uin16_t code)** _ 13.6 or E_05
244267
245268#### Wont (unless sponsored)
246269
0 commit comments