Skip to content

Commit f5b8c79

Browse files
committed
add many more panesl
1 parent 3eeba91 commit f5b8c79

File tree

4 files changed

+246
-5
lines changed

4 files changed

+246
-5
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/***************************************************
2+
Adafruit invests time and resources providing this open source code,
3+
please support Adafruit and open-source hardware by purchasing
4+
products from Adafruit!
5+
6+
Written by Limor Fried/Ladyada for Adafruit Industries.
7+
MIT license, all text above must be included in any redistribution
8+
****************************************************/
9+
10+
#include "Adafruit_ThinkInk.h"
11+
12+
/* breakout */
13+
14+
#define SRAM_CS -1
15+
16+
//ThinkInk_154_Grayscale4_T8 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
17+
//ThinkInk_213_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
18+
ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
19+
20+
#define COLOR1 EPD_BLACK
21+
#define COLOR2 EPD_LIGHT
22+
#define COLOR3 EPD_DARK
23+
24+
void setup() {
25+
Serial.begin(115200);
26+
while (!Serial) {
27+
delay(10);
28+
}
29+
Serial.println("Adafruit EPD full update test in mono & grayscale");
30+
}
31+
32+
bool gray = false;
33+
void loop() {
34+
35+
// alternate modes!
36+
if (gray) {
37+
display.begin(THINKINK_GRAYSCALE4);
38+
Serial.println("Grayscale!");
39+
} else {
40+
display.begin(THINKINK_MONO);
41+
Serial.println("Monochrome!");
42+
}
43+
44+
display.clearBuffer();
45+
display.setTextSize(3);
46+
display.setTextColor(EPD_BLACK);
47+
display.setCursor(20, 40);
48+
if (gray) {
49+
display.print("Grayscale");
50+
} else {
51+
display.print("Monochrome");
52+
}
53+
54+
55+
gray = !gray;
56+
57+
display.display();
58+
delay(1000);
59+
60+
display.clearBuffer();
61+
display.fillRect(display.width() / 4, 0, display.width() / 4, display.height(), EPD_LIGHT);
62+
display.fillRect((display.width() * 2) / 4, 0, display.width() / 4, display.height(), EPD_DARK);
63+
display.fillRect((display.width() * 3) / 4, 0, display.width() / 4, display.height(), EPD_BLACK);
64+
display.display();
65+
delay(2000);
66+
67+
Serial.println("Text demo");
68+
// large block of text
69+
display.clearBuffer();
70+
display.setTextSize(1);
71+
testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", COLOR1);
72+
display.display();
73+
delay(2000);
74+
75+
display.clearBuffer();
76+
for (int16_t i = 0; i < display.width(); i += 4) {
77+
display.drawLine(0, 0, i, display.height() - 1, COLOR1);
78+
}
79+
80+
for (int16_t i = 0; i < display.height(); i += 4) {
81+
display.drawLine(display.width() - 1, 0, 0, i, COLOR2); // on grayscale this will be mid-gray
82+
}
83+
display.display();
84+
delay(2000);
85+
}
86+
87+
88+
void testdrawtext(char *text, uint16_t color) {
89+
display.setCursor(0, 0);
90+
display.setTextColor(color);
91+
display.setTextWrap(true);
92+
display.print(text);
93+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/***************************************************
2+
Adafruit invests time and resources providing this open source code,
3+
please support Adafruit and open-source hardware by purchasing
4+
products from Adafruit!
5+
6+
Written by Limor Fried/Ladyada for Adafruit Industries.
7+
MIT license, all text above must be included in any redistribution
8+
****************************************************/
9+
10+
#include "Adafruit_ThinkInk.h"
11+
12+
#define SD_CS 5
13+
#define SRAM_CS 6
14+
#define EPD_CS 9
15+
#define EPD_DC 10
16+
#define EPD_RESET -1 // can set to -1 and share with microcontroller Reset!
17+
#define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
18+
19+
//ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20+
//ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
21+
//ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
22+
//ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23+
//ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
24+
//ThinkInk_420_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
25+
ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
26+
27+
void setup() {
28+
Serial.begin(115200);
29+
while (!Serial) { delay(10); }
30+
Serial.println("Adafruit EPD full update test in mono");
31+
display.begin(THINKINK_MONO);
32+
}
33+
34+
void loop() {
35+
Serial.println("Banner demo");
36+
display.clearBuffer();
37+
display.setTextSize(3);
38+
display.setCursor((display.width() - 180)/2, (display.height() - 24)/2);
39+
display.setTextColor(EPD_BLACK);
40+
display.print("Monochrome");
41+
display.display();
42+
43+
delay(2000);
44+
45+
Serial.println("B/W rectangle demo");
46+
display.clearBuffer();
47+
display.fillRect(display.width()/2, 0, display.width()/2, display.height(), EPD_BLACK);
48+
display.display();
49+
50+
delay(2000);
51+
52+
Serial.println("Text demo");
53+
// large block of text
54+
display.clearBuffer();
55+
display.setTextSize(1);
56+
testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", EPD_BLACK);
57+
display.display();
58+
59+
delay(2000);
60+
61+
display.clearBuffer();
62+
for (int16_t i=0; i<display.width(); i+=4) {
63+
display.drawLine(0, 0, i, display.height()-1, EPD_BLACK);
64+
}
65+
66+
for (int16_t i=0; i<display.height(); i+=4) {
67+
display.drawLine(display.width()-1, 0, 0, i, EPD_BLACK);
68+
}
69+
display.display();
70+
71+
delay(2000);
72+
}
73+
74+
75+
void testdrawtext(char *text, uint16_t color) {
76+
display.setCursor(0, 0);
77+
display.setTextColor(color);
78+
display.setTextWrap(true);
79+
display.print(text);
80+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/***************************************************
2+
Adafruit invests time and resources providing this open source code,
3+
please support Adafruit and open-source hardware by purchasing
4+
products from Adafruit!
5+
6+
Written by Limor Fried/Ladyada for Adafruit Industries.
7+
MIT license, all text above must be included in any redistribution
8+
****************************************************/
9+
10+
#include "Adafruit_ThinkInk.h"
11+
12+
#define EPD_CS 10
13+
#define EPD_DC 9
14+
#define SRAM_CS -1
15+
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
16+
#define EPD_BUSY 6 // can set to -1 to not use a pin (will wait a fixed delay)
17+
18+
//ThinkInk_290_Grayscale4 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
19+
ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20+
21+
void setup() {
22+
Serial.begin(115200);
23+
while (!Serial) { delay(10); }
24+
Serial.println("Adafruit counter");
25+
display.begin(THINKINK_MONO);
26+
display.setRotation(0);
27+
}
28+
29+
uint16_t counter = 0;
30+
31+
void loop() {
32+
display.clearBuffer();
33+
display.setTextSize(4);
34+
display.setTextColor(EPD_BLACK);
35+
display.setCursor(32, 32);
36+
display.print((counter / 1000) % 10);
37+
display.print((counter / 100) % 10);
38+
display.print((counter / 10) % 10);
39+
display.print(counter % 10);
40+
41+
if ((counter % 10) == 0) {
42+
display.display(false);
43+
} else {
44+
// redraw only 4th digit
45+
display.displayPartial(32+(24*3), 32, 32+(24*4), 32+(4*8));
46+
}
47+
48+
counter++;
49+
/*
50+
display.fillRect(0, 0, 16, 32, EPD_BLACK);
51+
display.fillRect(4, 4, 8, 24, EPD_WHITE);
52+
// display.display();
53+
display.displayPartial(0, 0, 16, 32);
54+
delay(3000);
55+
*/
56+
}

examples/ThinkInk_tricolor/ThinkInk_tricolor.ino

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99

1010
#include "Adafruit_ThinkInk.h"
1111

12+
1213
#define EPD_CS 10
1314
#define EPD_DC 9
14-
#define SRAM_CS 11
15+
#define SRAM_CS -1
1516
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
1617
#define EPD_BUSY 6 // can set to -1 to not use a pin (will wait a fixed delay)
1718

18-
//ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
19+
//ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20+
//ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
1921
//ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20-
ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
22+
//ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23+
//ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
24+
ThinkInk_420_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2125

2226
void setup() {
2327
Serial.begin(115200);
@@ -27,6 +31,7 @@ void setup() {
2731
}
2832

2933
void loop() {
34+
Serial.println("Banner demo");
3035
display.clearBuffer();
3136
display.setTextSize(3);
3237
display.setCursor((display.width() - 144)/2, (display.height() - 24)/2);
@@ -35,19 +40,25 @@ void loop() {
3540
display.setTextColor(EPD_RED);
3641
display.print("Color");
3742
display.display();
43+
44+
delay(15000);
3845

46+
Serial.println("Color rectangle demo");
3947
display.clearBuffer();
4048
display.fillRect(display.width()/3, 0, display.width()/3, display.height(), EPD_BLACK);
4149
display.fillRect((display.width()*2)/3, 0, display.width()/3, display.height(), EPD_RED);
4250
display.display();
4351

52+
delay(15000);
53+
4454
Serial.println("Text demo");
4555
// large block of text
4656
display.clearBuffer();
4757
display.setTextSize(1);
4858
testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", EPD_BLACK);
4959
display.display();
5060

61+
delay(15000);
5162

5263
display.clearBuffer();
5364
for (int16_t i=0; i<display.width(); i+=4) {
@@ -58,7 +69,8 @@ void loop() {
5869
display.drawLine(display.width()-1, 0, 0, i, EPD_RED);
5970
}
6071
display.display();
61-
delay(2000);
72+
73+
delay(15000);
6274
}
6375

6476

@@ -67,4 +79,4 @@ void testdrawtext(char *text, uint16_t color) {
6779
display.setTextColor(color);
6880
display.setTextWrap(true);
6981
display.print(text);
70-
}
82+
}

0 commit comments

Comments
 (0)