Skip to content

Commit 64ecece

Browse files
committed
1.3
1 parent 86dd1b0 commit 64ecece

File tree

7 files changed

+47
-4
lines changed

7 files changed

+47
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
| ![Disp1637_6-0.56](/img/Disp1637_6-0.56.webp) | TM1637 | 0.56" | [ссылка](https://fas.st/i0dmi?erid=LatgBbQo6) | `Disp1637_6` |
5252
| ![Disp595_4](/img/Disp595_4.webp) | 74HC595 | 0.36" | [ссылка](https://fas.st/WC-EE?erid=LatgBbQo6), [ссылка](https://fas.st/5d6JH?erid=LatgBbQo6), [ссылка](https://fas.st/UT6RqC?erid=LatgBbQo6) | `Disp595_4` |
5353
| ![Disp595_8](/img/Disp595_8.webp) | 74HC595 | 0.36" | [ссылка](https://fas.st/SzV0w?erid=LatgBbQo6), [ссылка](https://fas.st/YM7Fu?erid=LatgBbQo6) | `Disp595_8` |
54+
| ![Disp595_8](/img/Disp595_8v2.webp) | 74HC595 | 0.36"/0.56" | [ссылка](https://fas.st/6x9q9R?erid=LatgBbQo6) | `Disp595_8v2` |
5455
| ![Disp7219](/img/Disp7219.webp) | MAX7219 | 0.36" | [ссылка](https://fas.st/_ugxv1?erid=LatgBbQo6), [ссылка](https://fas.st/IqQly3?erid=LatgBbQo6) | `Disp7219` |
5556

5657
### Как устроена библиотека
@@ -86,6 +87,7 @@ void colon(bool show); // вкл-выкл двоеточие
8687
```cpp
8788
Disp595_4(uint8_t DIO, uint8_t SCLK, uint8_t RCLK); // Модуль 4 цифры
8889
Disp595_8(uint8_t DIO, uint8_t SCLK, uint8_t RCLK); // Модуль 8 цифр
90+
Disp595_8v2(uint8_t DIO, uint8_t SCLK, uint8_t RCLK); // Модуль 8 цифр, другая разводка
8991

9092
// у всех
9193
uint8_t tick(); // тикер динамической индикации, вызывать в loop
@@ -598,6 +600,7 @@ void loop() {
598600
- v1.2
599601
- Переписан драйвер яркости для динамических дисплеев. Снижена нагрузка на процессор, повышена стабильность
600602
- Добавлен ручной тикер для динамических дисплеев
603+
- v1.3 - добавлена поддержка дисплея Disp595_8v2
601604
602605
<a id="install"></a>
603606
## Установка

img/Disp595_8v2.webp

19.5 KB
Loading

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SegRunner KEYWORD1
1414

1515
Disp595_4 KEYWORD1
1616
Disp595_8 KEYWORD1
17+
Disp595_8v2 KEYWORD1
1718
Disp1637_4 KEYWORD1
1819
Disp1637_6 KEYWORD1
1920
Disp1637Colon KEYWORD1

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=GyverSegment
2-
version=1.2
2+
version=1.3
33
author=AlexGyver <[email protected]>
44
maintainer=AlexGyver <[email protected]>
55
sentence=Powerful library for controlling 7-segment indicators

src/GyverSegment.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88
#include "display/Disp595_4.h"
99
#include "display/Disp595_8.h"
10+
#include "display/Disp595_8v2.h"
1011
#include "display/Driver595.h"
1112
//
1213
#include "display/Disp1637Colon.h"

src/display/Disp595_8.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ class Disp595_8 : public Driver595, public SegBuffer {
1414

1515
// обновить дисплей
1616
void update() {
17-
for (uint8_t i = 0; i < 4; i++) {
18-
_buf[i] = ~buffer[i + 4];
19-
_buf[i + 4] = ~buffer[i];
17+
for (uint8_t i = 0; i < 8; i++) {
18+
_buf[i] = ~buffer[7 - i];
2019
}
2120
}
2221

src/display/Disp595_8v2.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#pragma once
2+
#include <Arduino.h>
3+
#include <GyverIO.h>
4+
5+
#include "Driver595.h"
6+
#include "utils/SegBuffer.h"
7+
8+
class Disp595_8v2 : public Driver595, public SegBuffer {
9+
public:
10+
// пины DIO, SCLK, RCLK
11+
Disp595_8v2(uint8_t DIO, uint8_t SCLK, uint8_t RCLK) : Driver595(DIO, SCLK, RCLK), SegBuffer(buffer, 8, 1) {
12+
update();
13+
}
14+
15+
// обновить дисплей
16+
void update() {
17+
for (uint8_t i = 0; i < 4; i++) {
18+
_buf[i] = ~buffer[i + 4];
19+
_buf[i + 4] = ~buffer[i];
20+
}
21+
}
22+
23+
// тикер динамической индикации, вызывать в loop постоянно
24+
uint8_t tick() {
25+
Driver595::tick(_buf, 8);
26+
return 0;
27+
}
28+
29+
// тикер динамической индикации, вызывать по своему таймеру
30+
uint8_t tickManual() {
31+
Driver595::tickManual(_buf, 8);
32+
return 0;
33+
}
34+
35+
uint8_t buffer[8] = {0};
36+
37+
private:
38+
uint8_t _buf[8] = {0};
39+
};

0 commit comments

Comments
 (0)