Skip to content

Commit c1315fc

Browse files
committed
update GitHub actions + PJH char
1 parent cac999d commit c1315fc

File tree

27 files changed

+153
-70
lines changed

27 files changed

+153
-70
lines changed

.github/workflows/arduino-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: arduino/arduino-lint-action@v1
9+
- uses: actions/checkout@v5
10+
- uses: arduino/arduino-lint-action@v2
1111
with:
1212
library-manager: update
1313
compliance: strict

.github/workflows/arduino_test_runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
timeout-minutes: 20
99

1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
- uses: ruby/setup-ruby@v1
1313
with:
1414
ruby-version: 2.6

.github/workflows/jsoncheck.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
paths:
66
- '**.json'
77
pull_request:
8+
paths:
9+
- '**.json'
810

911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
1214
timeout-minutes: 5
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1517
- name: json-syntax-check
1618
uses: limitusus/json-syntax-check@v2
1719
with:

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.4.2] - 2025-10-16
10+
- update GitHub actions
11+
- add P J and H characters
12+
- update examples
13+
- update readme.md
14+
- update keywords
15+
- minor edits
16+
917
## [0.4.1] - 2024-01-04
1018
- add constants for individual segments, kudos to DeflateAwning
1119
- add **demo_scrolling.ino**
1220
- update readme.md
1321

14-
1522
## [0.4.0] - 2023-12-05
1623
- refactor API, begin()
1724
- update readme.md

HT16K33.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: HT16K33.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.4.1
4+
// VERSION: 0.4.2
55
// DATE: 2019-02-07
66
// PURPOSE: Arduino Library for HT16K33 4x7segment display
77
// URL: https://github.com/RobTillaart/HT16K33
@@ -62,6 +62,9 @@ static const uint8_t charmap[] = { // TODO PROGMEM = slower?
6262
0x40, // minus
6363
0x61, // TOP_C
6464
0x63, // degree °
65+
0x73, // P = Pascal / Pressure
66+
0x0E, // J = Joule
67+
0x76, // H = Humidity
6568
};
6669

6770

HT16K33.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: HT16K33.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.4.1
5+
// VERSION: 0.4.2
66
// DATE: 2019-02-07
77
// PURPOSE: Arduino Library for HT16K33 4x7segment display
88
// http://www.adafruit.com/products/1002
@@ -13,7 +13,7 @@
1313
#include "Wire.h"
1414

1515

16-
#define HT16K33_LIB_VERSION (F("0.4.1"))
16+
#define HT16K33_LIB_VERSION (F("0.4.2"))
1717

1818

1919
// Supported characters
@@ -37,10 +37,13 @@
3737
#define HT16K33_MINUS 17
3838
#define HT16K33_TOP_C 18 // c
3939
#define HT16K33_DEGREE 19 // °
40+
#define HT16K33_P 20
41+
#define HT16K33_J 21
42+
#define HT16K33_H 22
4043
#define HT16K33_NONE 99
4144

4245

43-
// Raw segments, See #28
46+
// Raw 7 segment display, See #28
4447
//
4548
// HEX codes 7 segment
4649
//
@@ -50,6 +53,7 @@
5053
// E C 0x10 0x04
5154
// D dp 0x08 0x80
5255
//
56+
5357
const uint8_t SEG_NONE = 0x00;
5458
const uint8_t SEG_A = 0x01;
5559
const uint8_t SEG_B = 0x02;
@@ -61,6 +65,7 @@ const uint8_t SEG_G = 0x40;
6165
const uint8_t SEG_DP = 0x80;
6266

6367

68+
6469
class HT16K33
6570
{
6671
public:
@@ -69,6 +74,7 @@ class HT16K33
6974
bool begin();
7075
void reset();
7176
bool isConnected();
77+
uint8_t getAddress();
7278

7379
// default _cache is true as it is ~3x faster but if one has noise
7480
// on the I2C and wants to force refresh one can disable caching
@@ -133,7 +139,6 @@ class HT16K33
133139
void dumpSerial(uint8_t *array, uint8_t point);
134140
// display cache in HEX format
135141
void dumpSerial();
136-
uint8_t getAddress();
137142

138143

139144
// EXPERIMENTAL
@@ -148,11 +153,13 @@ class HT16K33
148153

149154

150155
// OBSOLETE 0.4.x
156+
[[deprecated("Use setBrightness() instead.")]]
151157
void brightness(uint8_t value) { setBrightness(value); };
158+
[[deprecated("Use setBlink() instead.")]]
152159
void blink(uint8_t value) { setBlink(value); };
153160

154161

155-
private:
162+
protected:
156163
void _refresh();
157164
void writeCmd(uint8_t cmd);
158165
void writePos(uint8_t pos, uint8_t mask);

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2024 Rob Tillaart
3+
Copyright (c) 2019-2025 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ it is faster for writing on average. The actual gain depends on the
2525
application and of course the values.
2626

2727

28-
#### 0.4.0 Breaking change
28+
### 0.4.0 Breaking change
2929

3030
Version 0.4.0 introduced a breaking change.
3131
You cannot set the pins in **begin()** any more.
@@ -65,27 +65,47 @@ With dual display it is important to **setDigits()** for the displays correctly
6565
get 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()**.
7897
Returns 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

100120
The 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.
120140
The unitChar must be one of the chars supported like HT16K33_C, HT16K33_TOP_C or HT16K33_DEGREE (see below).
121141
So **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.
169189
Prints 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

examples/demo1/demo1.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ uint32_t start, stop;
1616
void setup()
1717
{
1818
Serial.begin(115200);
19+
Serial.println();
1920
Serial.println(__FILE__);
2021
Serial.print("HT16K33_LIB_VERSION: ");
2122
Serial.println(HT16K33_LIB_VERSION);
23+
Serial.println();
2224

2325
Wire.begin();
2426
Wire.setClock(100000);

examples/demo2/demo2.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ uint32_t stop;
1717
void setup()
1818
{
1919
Serial.begin(115200);
20+
Serial.println();
2021
Serial.println(__FILE__);
2122
Serial.print("HT16K33_LIB_VERSION: ");
2223
Serial.println(HT16K33_LIB_VERSION);
24+
Serial.println();
2325

2426
Wire.begin();
2527
Wire.setClock(100000);
@@ -131,7 +133,7 @@ void loop()
131133
}
132134
stop = millis();
133135
Serial.println(stop - start);
134-
136+
135137
Serial.print("SUPRESS ZERO TEST:\t");
136138
for (uint8_t nlz = 0; nlz < 5; nlz++)
137139
{

0 commit comments

Comments
 (0)