Skip to content

Commit 2efde8a

Browse files
committed
Made some fixes on IP7 library
1 parent 9d7531f commit 2efde8a

File tree

16 files changed

+63
-60
lines changed

16 files changed

+63
-60
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
- name: ArduinoJson
6464
- name: Time
6565
- source-url: https://github.com/SolderedElectronics/Soldered-MFRC522-RFID-Reader-Arduino-Library.git
66+
- source-url: https://github.com/SolderedElectronics/Soldered-WS2812-Smart-Leds-Arduino-Library.git
6667
- source-url: https://github.com/SolderedElectronics/Soldered-BME280-BME680-Gas-Sensor-Arduino-Library.git
6768
sketch-paths: |
6869
${{ matrix.additional-sketch-paths }}

examples/Inkplate7/Advanced/Communication/Inkplate7_Second_SPI/Inkplate7_Second_SPI.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void setup()
5858

5959
// Set bigger text and print messages on the screen
6060
display.setTextSize(3);
61-
display.drawTextWithShadow(0, 0, "Second SPI example", INKPLATE_BLACK, INKPLATE_RED);
61+
display.drawTextWithShadow(0, 0, "Second SPI example", INKPLATE7_BLACK, INKPLATE7_RED);
6262

6363
display.setTextSize(2);
6464
display.println("\n\n\nOpen the Serial Monitor at 115200\nbaud rate to see what's happening");

examples/Inkplate7/Advanced/DeepSleep/Inkplate7_Wake_Up_Button/Inkplate7_Wake_Up_Button.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ void displayInfo()
7474

7575
// Set text cursor and size
7676
display.setCursor(10, 180);
77-
display.setTextColor(INKPLATE_BLACK);
77+
display.setTextColor(INKPLATE7_BLACK);
7878
display.setTextSize(2);
7979

8080
display.print(F("Boot count: "));
8181
display.println(bootCount, DEC); // Print the number
8282

8383
// Set next line cursor position
8484
display.setCursor(10, 220);
85-
display.setTextColor(INKPLATE_RED);
85+
display.setTextColor(INKPLATE7_RED);
8686

8787
// Display wake up reason
8888
esp_sleep_wakeup_cause_t wakeup_reason;

examples/Inkplate7/Advanced/SD/Inkplate7_SD_Pictures/Inkplate7_SD_Pictures.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ void setup()
4949
// removing the parameter completely
5050
Serial.println("Image open error");
5151
}
52+
Serial.print("Display before");
5253
display.display();
54+
Serial.print("Display done");
5355
delay(5000);
5456

5557
// Now try to load image using SdFat library class (for more advanced users) and display image on epaper.

examples/Inkplate7/Advanced/WEB_WiFi/Inkplate7_HTTPS_POST_Request/Inkplate7_HTTPS_POST_Request.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ void setup()
5353

5454
// Clear the display and print message
5555
display.clearDisplay();
56-
display.setTextColor(INKPLATE_BLACK);
56+
display.setTextColor(INKPLATE7_BLACK);
5757
display.setTextSize(3);
5858
display.println("HTTPS POST Request example");
5959
display.println();
6060

6161
display.setTextSize(2);
62-
display.setTextColor(INKPLATE_RED);
62+
display.setTextColor(INKPLATE7_RED);
6363
display.println("Open Serial Monitor at 115200 baud rate to see what'shappening");
6464
display.display();
6565

examples/Inkplate7/Advanced/WEB_WiFi/Inkplate7_HTTP_POST_Request/Inkplate7_HTTP_POST_Request.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ void setup()
6262
display.clearDisplay();
6363

6464
// Set text color and size
65-
display.setTextColor(INKPLATE_BLACK);
65+
display.setTextColor(INKPLATE7_BLACK);
6666
display.setTextSize(3);
6767

6868
// Display a message
6969
display.println("HTTP POST request example");
7070
display.println();
71-
display.setTextColor(INKPLATE_RED);
71+
display.setTextColor(INKPLATE7_RED);
7272
display.setTextSize(2);
7373
display.println("Open Serial Monitor at 115200 baud rate to see what'shappening");
7474
display.display();

examples/Inkplate7/Advanced/WEB_WiFi/Inkplate7_HTTP_Request/Inkplate7_HTTP_Request.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void setup()
3535
Serial.begin(115200); // Init serial communication
3636
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
3737
display.clearDisplay(); // Clear frame buffer of display
38-
display.setTextColor(INKPLATE_BLACK, INKPLATE_WHITE); // Set text color to black and background color to white
38+
display.setTextColor(INKPLATE7_BLACK, INKPLATE7_WHITE); // Set text color to black and background color to white
3939
Serial.println("Scanning for WiFi networks..."); // Write text
4040

4141
// Start searching WiFi networks and put the nubmer of found WiFi networks in variable n

examples/Inkplate7/Advanced/WEB_WiFi/Inkplate7_Web_Server/Inkplate7_Web_Server.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void setup()
4949
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
5050
display.clearDisplay(); // Clear frame buffer of display
5151
display.setTextSize(2); // Scale text to be two times bigger then original (5x7 px)
52-
display.setTextColor(INKPLATE_BLACK); // Set text color to black and background color to white
52+
display.setTextColor(INKPLATE7_BLACK); // Set text color to black and background color to white
5353
display.setTextWrap(true); // If text does not fit on screen, send it to new line
5454

5555
WiFi.begin(); // Init. WiFi library
@@ -108,7 +108,7 @@ void updatePaper()
108108
display.setCursor(270, 95);
109109
display.println(pass);
110110
display.setCursor(140, 150);
111-
display.setTextColor(INKPLATE_RED);
111+
display.setTextColor(INKPLATE7_RED);
112112
display.print("Open Your web browser and open");
113113
display.setCursor(210, 210);
114114
display.print("http://");
@@ -117,7 +117,7 @@ void updatePaper()
117117
display.println();
118118
display.fillRect(10, 240, 620, 4, BLACK);
119119
display.setCursor(0, 250);
120-
display.setTextColor(INKPLATE_BLACK);
120+
display.setTextColor(INKPLATE7_BLACK);
121121
display.println("User text:"); // Print out what user typed in web page
122122
display.print(txt);
123123
display.display(); // Send everything to screen (refresh the screen)

examples/Inkplate7/Basic/Inkplate7_Black_White_Red/Inkplate7_Black_White_Red.ino

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ void setup()
3131
display.clearDisplay(); // Clear any data that may have been in (software) frame buffer.
3232
//(NOTE! This does not clean image on screen, it only clears it in the frame buffer inside ESP32).
3333
display.setTextSize(4); // Set text size to be 4 times bigger than original (5x7 pix)
34-
display.drawTextWithShadow(50, 175, "Welcome to Inkplate 7!", INKPLATE_BLACK, INKPLATE_RED); // Draw a text with shadow
35-
display.setTextColor(INKPLATE_BLACK, INKPLATE_WHITE); // Set text color to black and background to white
34+
display.drawTextWithShadow(50, 175, "Welcome to Inkplate 7!", INKPLATE7_BLACK, INKPLATE7_RED); // Draw a text with shadow
35+
display.setTextColor(INKPLATE7_BLACK, INKPLATE7_WHITE); // Set text color to black and background to white
3636
display.display(); // This line actually drawing on the Inkplate screen, previous lines just drawing into the frame
3737
// buffer
3838
delay(DELAY_MS); // Wait a little bit
@@ -45,9 +45,9 @@ void setup()
4545
displayCurrentAction("Drawing two pixels in different colors"); // Function which writes small text at bottom left
4646
// indicating what's currently done
4747
// NOTE: you do not need displayCurrentAction function to use Inkplate!
48-
display.drawPixel(300, 192, INKPLATE_BLACK); // Draw one black pixel at X = 300, Y = 192 position in black color
48+
display.drawPixel(300, 192, INKPLATE7_BLACK); // Draw one black pixel at X = 300, Y = 192 position in black color
4949

50-
display.drawPixel(340, 192, INKPLATE_RED); // Draw one black pixel at X = 340, Y = 192 position in red color
50+
display.drawPixel(340, 192, INKPLATE7_RED); // Draw one black pixel at X = 340, Y = 192 position in red color
5151

5252
display.display(); // Send image to display. You need to call this one each time you want to transfer frame buffer
5353
// to the screen.
@@ -69,8 +69,8 @@ void setup()
6969

7070
// All of those drawing fuctions originate from Adafruit GFX library, so maybe you are already familiar with those.
7171
// Arguments are: start X, start Y, ending X, ending Y, color.
72-
display.drawLine(0, 0, E_INK_WIDTH, E_INK_HEIGHT, INKPLATE_BLACK);
73-
display.drawLine(E_INK_WIDTH, 0, 0, E_INK_HEIGHT, INKPLATE_RED);
72+
display.drawLine(0, 0, E_INK_WIDTH, E_INK_HEIGHT, INKPLATE7_BLACK);
73+
display.drawLine(E_INK_WIDTH, 0, 0, E_INK_HEIGHT, INKPLATE7_RED);
7474
displayCurrentAction("Drawing two diagonal lines");
7575
display.display();
7676
delay(DELAY_MS);
@@ -99,14 +99,14 @@ void setup()
9999

100100
// Now draw one horizontal...
101101
display.clearDisplay();
102-
display.drawFastHLine(50, 192, 540, INKPLATE_BLACK); // Arguments are: starting X, starting Y, length, color
102+
display.drawFastHLine(50, 192, 540, INKPLATE7_BLACK); // Arguments are: starting X, starting Y, length, color
103103
displayCurrentAction("Drawing one horizontal line");
104104
display.display();
105105
delay(DELAY_MS);
106106

107107
//... and one vertical line
108108
display.clearDisplay();
109-
display.drawFastVLine(320, 42, 300, INKPLATE_RED); // Arguments are: starting X, starting Y, length, color
109+
display.drawFastVLine(320, 42, 300, INKPLATE7_RED); // Arguments are: starting X, starting Y, length, color
110110
displayCurrentAction("Drawing one vertical line");
111111
display.display();
112112
delay(DELAY_MS);
@@ -115,19 +115,19 @@ void setup()
115115
display.clearDisplay();
116116
for (int i = 0; i < E_INK_WIDTH; i += 8)
117117
{
118-
display.drawFastVLine(i, 0, E_INK_HEIGHT, INKPLATE_BLACK);
118+
display.drawFastVLine(i, 0, E_INK_HEIGHT, INKPLATE7_BLACK);
119119
}
120120
for (int i = 0; i < E_INK_HEIGHT; i += 8)
121121
{
122-
display.drawFastHLine(0, i, E_INK_WIDTH, INKPLATE_RED);
122+
display.drawFastHLine(0, i, E_INK_WIDTH, INKPLATE7_RED);
123123
}
124124
displayCurrentAction("Drawing a grid using horizontal and vertical lines");
125125
display.display();
126126
delay(DELAY_MS);
127127

128128
// Draw rectangle at X = 150, Y = 100 and size of 340x184 pixels
129129
display.clearDisplay();
130-
display.drawRect(150, 100, 340, 184, INKPLATE_BLACK); // Arguments are: start X, start Y, size X, size Y, color
130+
display.drawRect(150, 100, 340, 184, INKPLATE7_BLACK); // Arguments are: start X, start Y, size X, size Y, color
131131
displayCurrentAction("Drawing a rectangle");
132132
display.display();
133133
delay(DELAY_MS);
@@ -144,7 +144,7 @@ void setup()
144144

145145
// Draw filled black rectangle at X = 150, Y = 100, size of 340x184 pixels
146146
display.clearDisplay();
147-
display.fillRect(150, 100, 340, 184, INKPLATE_BLACK); // Arguments are: start X, start Y, size X, size Y, color
147+
display.fillRect(150, 100, 340, 184, INKPLATE7_BLACK); // Arguments are: start X, start Y, size X, size Y, color
148148
displayCurrentAction("Drawing a black rectangle");
149149
display.display();
150150
delay(DELAY_MS);
@@ -162,7 +162,7 @@ void setup()
162162
// Draw a red circle at the center of the screen with radius of 75 pixels
163163
display.clearDisplay();
164164
display.drawCircle(E_INK_WIDTH / 2, E_INK_HEIGHT / 2, 75,
165-
INKPLATE_RED); // Arguments are: start X, start Y, radius, color
165+
INKPLATE7_RED); // Arguments are: start X, start Y, radius, color
166166
displayCurrentAction("Drawing a circle");
167167
display.display();
168168
delay(DELAY_MS);
@@ -180,7 +180,7 @@ void setup()
180180
// Draw a black filled circle at the center of the screen with radius of 75 pixels
181181
display.clearDisplay();
182182
display.fillCircle(E_INK_WIDTH / 2, E_INK_HEIGHT / 2, 75,
183-
INKPLATE_BLACK); // Arguments are: start X, start Y, radius, color
183+
INKPLATE7_BLACK); // Arguments are: start X, start Y, radius, color
184184
displayCurrentAction("Drawing black-filled circle");
185185
display.display();
186186
delay(DELAY_MS);
@@ -198,7 +198,7 @@ void setup()
198198
// Draw rounded rectangle at X = 150, Y = 100 and size of 340x184 pixels and radius of 10 pixels
199199
display.clearDisplay();
200200
display.drawRoundRect(150, 100, 340, 184, 10,
201-
INKPLATE_RED); // Arguments are: start X, start Y, size X, size Y, radius, color
201+
INKPLATE7_RED); // Arguments are: start X, start Y, size X, size Y, radius, color
202202
displayCurrentAction("Drawing a rectangle with rounded edges");
203203
display.display();
204204
delay(DELAY_MS);
@@ -216,7 +216,7 @@ void setup()
216216
// Draw filled black rect at X = 150, Y = 100, size of 340x184 pixels and radius of 10 pixels
217217
display.clearDisplay();
218218
display.fillRoundRect(150, 100, 340, 184, 10,
219-
INKPLATE_BLACK); // Arguments are: start X, start Y, size X, size Y, radius, color
219+
INKPLATE7_BLACK); // Arguments are: start X, start Y, size X, size Y, radius, color
220220
displayCurrentAction("This is filled rectangle with rounded edges");
221221
display.display();
222222
delay(DELAY_MS);
@@ -233,28 +233,28 @@ void setup()
233233

234234
// Draw simple triangle
235235
display.clearDisplay();
236-
display.drawTriangle(215, 290, 320, 80, 425, 290, INKPLATE_RED); // Arguments are: X1, Y1, X2, Y2, X3, Y3, color
236+
display.drawTriangle(215, 290, 320, 80, 425, 290, INKPLATE7_RED); // Arguments are: X1, Y1, X2, Y2, X3, Y3, color
237237
displayCurrentAction("Drawing a triangle");
238238
display.display();
239239
delay(DELAY_MS);
240240

241241
// Draw filled triangle inside simple triangle (so no display.clearDisplay() this time)
242-
display.fillTriangle(260, 260, 320, 140, 380, 260, INKPLATE_BLACK); // Arguments are: X1, Y1, X2, Y2, X3, Y3, color
242+
display.fillTriangle(260, 260, 320, 140, 380, 260, INKPLATE7_BLACK); // Arguments are: X1, Y1, X2, Y2, X3, Y3, color
243243
displayCurrentAction("Drawing a triangle inside exsisting one"); // This will be written over the existing text so
244244
// that the previous text will not be seen
245245
display.display();
246246
delay(DELAY_MS);
247247

248248
// Draws an elipse with x radius, y radius, center x, center y and color
249249
display.clearDisplay();
250-
display.drawElipse(125, 75, E_INK_WIDTH / 2, E_INK_HEIGHT / 2, INKPLATE_RED);
250+
display.drawElipse(125, 75, E_INK_WIDTH / 2, E_INK_HEIGHT / 2, INKPLATE7_RED);
251251
displayCurrentAction("Drawing an elipse");
252252
display.display();
253253
delay(DELAY_MS);
254254

255255
// Fills an elipse with x radius, y radius, center x, center y and color
256256
display.clearDisplay();
257-
display.fillElipse(125, 75, E_INK_WIDTH / 2, E_INK_HEIGHT / 2, INKPLATE_RED);
257+
display.fillElipse(125, 75, E_INK_WIDTH / 2, E_INK_HEIGHT / 2, INKPLATE7_RED);
258258
displayCurrentAction("Drawing a filled elipse");
259259
display.display();
260260
delay(DELAY_MS);
@@ -281,7 +281,7 @@ void setup()
281281

282282
// Draws a polygon, from x and y coordinate arrays of n points in color c
283283
display.clearDisplay();
284-
display.drawPolygon(xt, yt, n, INKPLATE_BLACK);
284+
display.drawPolygon(xt, yt, n, INKPLATE7_BLACK);
285285
displayCurrentAction("Drawing a polygon");
286286
display.display();
287287
delay(DELAY_MS);
@@ -290,15 +290,15 @@ void setup()
290290
// Points need to be counter clockwise sorted
291291
// Method can be quite slow for now, probably will improve
292292
display.clearDisplay();
293-
display.fillPolygon(xt, yt, n, INKPLATE_RED);
293+
display.fillPolygon(xt, yt, n, INKPLATE7_RED);
294294
displayCurrentAction("Drawing a filled polygon");
295295
display.display();
296296
delay(DELAY_MS);
297297

298298
// Write text and rotate it by 90 deg. forever
299299
int r = 0;
300300
display.setTextSize(5);
301-
display.setTextColor(INKPLATE_WHITE, INKPLATE_BLACK);
301+
display.setTextColor(INKPLATE7_WHITE, INKPLATE7_BLACK);
302302
while (true)
303303
{
304304
display.setRotation(r % 4);

examples/Inkplate7/Basic/Inkplate7_Text_With_Shadow/Inkplate7_Text_With_Shadow.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@ void setup()
3232
display.begin();
3333

3434
display.setTextSize(5); // Set text size to be 5 times bigger than original (5x7 px)
35-
display.setTextColor(INKPLATE_BLACK, INKPLATE_WHITE); // Set the text color to black, and the background to white
35+
display.setTextColor(INKPLATE7_BLACK, INKPLATE7_WHITE); // Set the text color to black, and the background to white
3636
display.setCursor(70, 80); // Set cursor position
3737

3838
// Draw black text
3939
display.print("Inkplate 7"); // Print text in the frame buffer
4040

4141
// Draw red text
42-
display.setTextColor(INKPLATE_RED);
42+
display.setTextColor(INKPLATE7_RED);
4343
display.setCursor(70, 130);
4444
display.println("Inkplate 7");
4545

4646
// Draw text with shadow, specify color for text and background
4747
// (x coordinate, y coordinate, string to write, text color, shadow color)
48-
display.drawTextWithShadow(70, 180, "Inkplate 7", INKPLATE_RED, INKPLATE_BLACK);
48+
display.drawTextWithShadow(70, 180, "Inkplate 7", INKPLATE7_RED, INKPLATE7_BLACK);
4949

5050
// Draw a text with shadow with swapped colors
5151
display.setTextSize(3);
52-
display.drawTextWithShadow(300, 280, "By soldered.com", INKPLATE_BLACK, INKPLATE_RED);
52+
display.drawTextWithShadow(300, 280, "By soldered.com", INKPLATE7_BLACK, INKPLATE7_RED);
5353

5454
// Other basic drawing functions supported
55-
display.drawLine(70, 250, 300, 350, INKPLATE_RED);
56-
display.drawCircle(500, 150, 75, INKPLATE_BLACK);
55+
display.drawLine(70, 250, 300, 350, INKPLATE7_RED);
56+
display.drawCircle(500, 150, 75, INKPLATE7_BLACK);
5757

5858
// Display to screen
5959
display.display();

0 commit comments

Comments
 (0)