@@ -31,8 +31,8 @@ void setup()
31
31
display.clearDisplay (); // Clear any data that may have been in (software) frame buffer.
32
32
// (NOTE! This does not clean image on screen, it only clears it in the frame buffer inside ESP32).
33
33
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
36
36
display.display (); // This line actually drawing on the Inkplate screen, previous lines just drawing into the frame
37
37
// buffer
38
38
delay (DELAY_MS); // Wait a little bit
@@ -45,9 +45,9 @@ void setup()
45
45
displayCurrentAction (" Drawing two pixels in different colors" ); // Function which writes small text at bottom left
46
46
// indicating what's currently done
47
47
// 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
49
49
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
51
51
52
52
display.display (); // Send image to display. You need to call this one each time you want to transfer frame buffer
53
53
// to the screen.
@@ -69,8 +69,8 @@ void setup()
69
69
70
70
// All of those drawing fuctions originate from Adafruit GFX library, so maybe you are already familiar with those.
71
71
// 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 );
74
74
displayCurrentAction (" Drawing two diagonal lines" );
75
75
display.display ();
76
76
delay (DELAY_MS);
@@ -99,14 +99,14 @@ void setup()
99
99
100
100
// Now draw one horizontal...
101
101
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
103
103
displayCurrentAction (" Drawing one horizontal line" );
104
104
display.display ();
105
105
delay (DELAY_MS);
106
106
107
107
// ... and one vertical line
108
108
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
110
110
displayCurrentAction (" Drawing one vertical line" );
111
111
display.display ();
112
112
delay (DELAY_MS);
@@ -115,19 +115,19 @@ void setup()
115
115
display.clearDisplay ();
116
116
for (int i = 0 ; i < E_INK_WIDTH; i += 8 )
117
117
{
118
- display.drawFastVLine (i, 0 , E_INK_HEIGHT, INKPLATE_BLACK );
118
+ display.drawFastVLine (i, 0 , E_INK_HEIGHT, INKPLATE7_BLACK );
119
119
}
120
120
for (int i = 0 ; i < E_INK_HEIGHT; i += 8 )
121
121
{
122
- display.drawFastHLine (0 , i, E_INK_WIDTH, INKPLATE_RED );
122
+ display.drawFastHLine (0 , i, E_INK_WIDTH, INKPLATE7_RED );
123
123
}
124
124
displayCurrentAction (" Drawing a grid using horizontal and vertical lines" );
125
125
display.display ();
126
126
delay (DELAY_MS);
127
127
128
128
// Draw rectangle at X = 150, Y = 100 and size of 340x184 pixels
129
129
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
131
131
displayCurrentAction (" Drawing a rectangle" );
132
132
display.display ();
133
133
delay (DELAY_MS);
@@ -144,7 +144,7 @@ void setup()
144
144
145
145
// Draw filled black rectangle at X = 150, Y = 100, size of 340x184 pixels
146
146
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
148
148
displayCurrentAction (" Drawing a black rectangle" );
149
149
display.display ();
150
150
delay (DELAY_MS);
@@ -162,7 +162,7 @@ void setup()
162
162
// Draw a red circle at the center of the screen with radius of 75 pixels
163
163
display.clearDisplay ();
164
164
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
166
166
displayCurrentAction (" Drawing a circle" );
167
167
display.display ();
168
168
delay (DELAY_MS);
@@ -180,7 +180,7 @@ void setup()
180
180
// Draw a black filled circle at the center of the screen with radius of 75 pixels
181
181
display.clearDisplay ();
182
182
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
184
184
displayCurrentAction (" Drawing black-filled circle" );
185
185
display.display ();
186
186
delay (DELAY_MS);
@@ -198,7 +198,7 @@ void setup()
198
198
// Draw rounded rectangle at X = 150, Y = 100 and size of 340x184 pixels and radius of 10 pixels
199
199
display.clearDisplay ();
200
200
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
202
202
displayCurrentAction (" Drawing a rectangle with rounded edges" );
203
203
display.display ();
204
204
delay (DELAY_MS);
@@ -216,7 +216,7 @@ void setup()
216
216
// Draw filled black rect at X = 150, Y = 100, size of 340x184 pixels and radius of 10 pixels
217
217
display.clearDisplay ();
218
218
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
220
220
displayCurrentAction (" This is filled rectangle with rounded edges" );
221
221
display.display ();
222
222
delay (DELAY_MS);
@@ -233,28 +233,28 @@ void setup()
233
233
234
234
// Draw simple triangle
235
235
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
237
237
displayCurrentAction (" Drawing a triangle" );
238
238
display.display ();
239
239
delay (DELAY_MS);
240
240
241
241
// 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
243
243
displayCurrentAction (" Drawing a triangle inside exsisting one" ); // This will be written over the existing text so
244
244
// that the previous text will not be seen
245
245
display.display ();
246
246
delay (DELAY_MS);
247
247
248
248
// Draws an elipse with x radius, y radius, center x, center y and color
249
249
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 );
251
251
displayCurrentAction (" Drawing an elipse" );
252
252
display.display ();
253
253
delay (DELAY_MS);
254
254
255
255
// Fills an elipse with x radius, y radius, center x, center y and color
256
256
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 );
258
258
displayCurrentAction (" Drawing a filled elipse" );
259
259
display.display ();
260
260
delay (DELAY_MS);
@@ -281,7 +281,7 @@ void setup()
281
281
282
282
// Draws a polygon, from x and y coordinate arrays of n points in color c
283
283
display.clearDisplay ();
284
- display.drawPolygon (xt, yt, n, INKPLATE_BLACK );
284
+ display.drawPolygon (xt, yt, n, INKPLATE7_BLACK );
285
285
displayCurrentAction (" Drawing a polygon" );
286
286
display.display ();
287
287
delay (DELAY_MS);
@@ -290,15 +290,15 @@ void setup()
290
290
// Points need to be counter clockwise sorted
291
291
// Method can be quite slow for now, probably will improve
292
292
display.clearDisplay ();
293
- display.fillPolygon (xt, yt, n, INKPLATE_RED );
293
+ display.fillPolygon (xt, yt, n, INKPLATE7_RED );
294
294
displayCurrentAction (" Drawing a filled polygon" );
295
295
display.display ();
296
296
delay (DELAY_MS);
297
297
298
298
// Write text and rotate it by 90 deg. forever
299
299
int r = 0 ;
300
300
display.setTextSize (5 );
301
- display.setTextColor (INKPLATE_WHITE, INKPLATE_BLACK );
301
+ display.setTextColor (INKPLATE7_WHITE, INKPLATE7_BLACK );
302
302
while (true )
303
303
{
304
304
display.setRotation (r % 4 );
0 commit comments