Skip to content

Commit 2e2f5ae

Browse files
committed
Fixes for ESP8266
1 parent 12a966b commit 2e2f5ae

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ledtest/LEDDisplayDriver.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// There is nothing to adjust in this module, everything is controlled from the .h file.
1010
// By HKJ from lygte-info.dk
1111

12+
#define min(a,b) ((a<b)?a:b)
1213

1314
const DIGIT_TYPE segmentPatterns[] = {
1415
digit0, digit1, digit2, digit3, digit4, digit5, digit6, digit7,

ledtest/LEDDisplayDriver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ const DIGIT_TYPE digitG = SEG_A | SEG_C | SEG_D | SEG_E | SEG_F | SEG_H;
869869
const DIGIT_TYPE digitH = SEG_B | SEG_C | SEG_E | SEG_F | SEG_G | SEG_H;
870870
const DIGIT_TYPE digitI = SEG_A | SEG_D | SEG_L | SEG_O;
871871
const DIGIT_TYPE digitJ = SEG_B | SEG_C | SEG_D | SEG_E;
872-
const DIGIT_TYPE digitK = SEG_E | SEG_F | SEG_G | SEG_M | SEG_H | SEG_C;
872+
const DIGIT_TYPE digitK = SEG_E | SEG_F | SEG_G | SEG_M | SEG_P;
873873
const DIGIT_TYPE digitL = SEG_D | SEG_E | SEG_F;
874874
const DIGIT_TYPE digitM = SEG_B | SEG_C | SEG_E | SEG_F | SEG_K | SEG_M;
875875
const DIGIT_TYPE digitN = SEG_B | SEG_C | SEG_E | SEG_F | SEG_K | SEG_P;

ledtest/ledtest.ino

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33

44
// Manual for library: http://lygte-info.dk/project/DisplayDriver%20UK.html
55

6-
const byte numberOfDigits = 16;
7-
const byte dataPin = A4;
8-
const byte clockPin = A5;
9-
const byte loadPin = A2;
6+
#define NUM_DIGITS 16
7+
const byte dataPin = D0;
8+
const byte clockPin = D1;
109

11-
LEDDisplayDriver display(dataPin, clockPin, loadPin);
10+
LEDDisplayDriver display(dataPin, clockPin, true, NUM_DIGITS);
1211

1312
void setup() {
14-
Serial.begin(9600);
13+
Serial.begin(115200);
1514
Serial.println("Hello ledtest");
1615

1716
for (int i = 0; i < 255; ++i) {
1817
if (!isprint(i)) continue;
19-
display.showChar(i % numberOfDigits, i);
18+
display.showChar(i % NUM_DIGITS, i);
2019
delay(200);
2120
}
2221
display.showTextScroll("Tell me something");

0 commit comments

Comments
 (0)