Skip to content

Commit 9718af5

Browse files
authored
fixed example, updated readme
1 parent f834d57 commit 9718af5

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# esp8266-hw-spi-max7219-7seg
22
Library for 7segment max7219 modules conncted to ESP8266 using HW SPI
33

4+
Supports
5+
* chained modules
6+
* displaying of numbers and characters A-Z including decimal dots
7+
* using ESP8266 HW SPI
8+
49
## Hardware setup:
510
* GPIO13 -> DIN
611
* GPIO14 -> CLK
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
/* Include Library */
3+
#include <esp8266-hw-spi-max7219-7seg.h>
4+
5+
// configuration
6+
#define SPI_SPEED 8000000 //SPI@8MHZ
7+
#define SPI_CSPIN 5 //SPI CS=GPIO5
8+
#define DISP_BRGTH 8 //brightness of the display (0-15)
9+
#define DISP_AMOUNT 2 //number of max 7seg modules connected
10+
11+
BgrMax7seg ld = BgrMax7seg(SPI_SPEED, SPI_CSPIN, DISP_AMOUNT);
12+
13+
void setup() {
14+
/* init displays*/
15+
ld.init();
16+
ld.setBright(DISP_BRGTH, ALL_MODULES);
17+
ld.print("test.test", ALL_MODULES); // prints string "test.test" on all connected modules
18+
}
19+
20+
void loop() {
21+
delay(5000);
22+
ld.clear(ALL_MODULES); //clear all displays
23+
delay(1000);
24+
25+
/* Print some numbers */
26+
for (int i = -10; i <= 100; i++) {
27+
ld.print(String(i), 1); //from -10 to 100 on display 1
28+
ld.print(String(i / 4.0, 3), 2); //value above divided by 4, show 3 decimal places on display 2
29+
delay(500);
30+
}
31+
}

keywords.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ BgrMax7seg KEYWORD1
1212
# Methods and Functions (KEYWORD2)
1313
#######################################
1414

15-
clear KEYWORD2
15+
clear KEYWORD2
1616
setBright KEYWORD2
17-
setDigitLimit KEYWORD2
18-
on KEYWORD2
19-
off KEYWORD2
20-
printDigit KEYWORD2
21-
write KEYWORD2
17+
init KEYWORD2
18+
on KEYWORD2
19+
off KEYWORD2
20+
print KEYWORD2
21+
write KEYWORD2
2222

2323
#######################################
2424
# Constants (LITERAL1)

library.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name=ESP8266-HW-SPI-MAX7219-7seg
2-
version=2.0.0
1+
name=esp8266-hw-spi-max7219-7seg
2+
version=2.0.1
33
author=Buger - based on Ozhan Duran <[email protected]>
4-
maintainer=Buger
4+
maintainer=BugerDread
55
sentence=Multi MAX7219 7-Segment LED Display HW SPI Lib
6-
paragraph=Librery to use 1 or more MAX7219 7segment modules with ESP8266 over HW SPI
6+
paragraph=Library to use 1 or more MAX7219 7segment modules with ESP8266 over HW SPI
77
category=Display
8-
url=http://buger.dread.cz
8+
url=https://github.com/BugerDread/esp8266-hw-spi-max7219-7seg
99
architectures=*
1010
includes=esp8266-hw-spi-max7219-7seg.h

0 commit comments

Comments
 (0)