Skip to content

Commit c8057de

Browse files
committed
edited some examples for inkplate4
1 parent d5bfbc0 commit c8057de

File tree

8 files changed

+170
-87
lines changed

8 files changed

+170
-87
lines changed

examples/Inkplate10/Advanced/DeepSleep/Inkplate10_Wake_Up_On_Touchpads/Inkplate10_Wake_Up_On_Touchpads.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
1818
#if !defined(ARDUINO_INKPLATE10) && !defined(ARDUINO_INKPLATE10V2)
19-
#error \
20-
"Wrong board selection for this example, please select e-radionica Inkplate10 in the boards menu."
19+
#error "Wrong board selection for this example, please select e-radionica Inkplate10 in the boards menu."
2120
#endif
2221

2322
// Include Inkplate library to the sketch

examples/Inkplate4/Advanced/IO/Inkplate4_Internal_IO_Expander/Inkplate4_Internal_IO_Expander.ino

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55
Don't have "Soldered Inkplate4" option? Follow our tutorial and add it:
66
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
77
8+
Only pins P1-1 and P1-2 will not work without cutting the jumpers JP2 and JP3 and soldering
9+
them on the other side because it's used for charging LED and controlling MOSFET for an SD card.
10+
811
Connect resistor to P1-7 on IO expander header at the top on the backside
912
(component side) of Inkplate. You will have to connect one side of 330 Ohm resistor to P1-7, then other side
1013
to anode of LED and finally, cathode pin of LED to GND.
1114
1215
This example will show you how you can manipulate with I/Os of internal IO Expander.
13-
You can only manipulate with Port B of IO Expander (P1-1->P1-7). Port 0 (or Port A) is used for epaper
14-
panel and TPS65186 PMIC.
15-
P1-0 is used for ESP32 GPIO0 so you can't use it either.
16-
P1-1 is used for enabling battery reading (if Batt solder bridge is bridged between second and third pad).
17-
P1-2 is used for tunring on and off the MOSFET for SD card (if solder bridge is bridged between second and third
18-
pad). If everything is connected ok, after you upload code, LED should blink.
19-
20-
DANGER: DO NOT USE P0-0 -> P0-7 and P1-0. In code those are pins from 0-8!!! Using those, you
21-
might permanently damage the screen. You should only use pins from 9-15.
16+
If everything is connected ok, after you upload code, LED should blink.
2217
2318
Want to learn more about Inkplate? Visit www.inkplate.io
2419
Looking to get support? Write on our forums: https://forum.soldered.com/
@@ -32,8 +27,8 @@
3227

3328
#include "Inkplate.h" // Include Inkplate library to the sketch
3429

35-
// We are going to use pin P1-7.
36-
// Remember! P0-0 = 0, P0-1 = 1, ..., P0-7 = 7, P1-0 = 8, P1-1 = 9, ..., P1-7 = 15.
30+
// We are going to use pin P1-7
31+
// Remember! P0-0 = 0, P0-1 = 1, ..., P0-7 = 7, P1-0 = 8, P1-1 = 9, ..., P1-7 = 15
3732
#define LED_PIN IO_PIN_B7
3833

3934
Inkplate display; // Create an object on Inkplate library

examples/Inkplate4/Advanced/Other/Inkplate4_EEPROM_Usage/Inkplate4_EEPROM_Usage.ino

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,30 @@ Inkplate display; // Create object on Inkplate library
3030
void setup()
3131
{
3232
// Init library (you should call this function ONLY ONCE)
33-
display.begin();
33+
display.begin();
34+
35+
// Init serial communication
36+
Serial.begin(115200);
3437

3538
// Init EEPROM library with 128 of EEPROM size.
3639
EEPROM.begin(EEPROM_SIZE);
3740

38-
display.setTextSize(4); // Set text size
41+
display.setTextSize(2); // Set text size
3942
display.println("Clearing EEPROM...\n"); // Print message
40-
display.display(); // Full refresh the display
43+
Serial.println("Clearing EEPROM...\n"); // Print message
4144
clearEEPROM(); // Clear user EEPROM data
4245
delay(500); // Wait a little bit...
4346

47+
Serial.println("Writing data to EEPROM...\n"); // Print message
4448
display.println("Writing data to EEPROM...\n"); // Print message
45-
display.partialUpdate(); // Use partial updates for refreshing the display
4649
writeEEPROM(); // Write some data to EEPROM
4750
delay(500); // Wait a little bit...
4851

52+
Serial.println("Reading data from EEPROM:\n"); // Print message
4953
display.println("Reading data from EEPROM:\n"); // Print message
50-
display.partialUpdate(); // Use partial updates for refreshing the display
51-
display.setTextSize(2); // Use smaller text so everything can fit on display
54+
display.setTextSize(1); // Use smaller text so everything can fit on display
5255
printEEPROM(); // Read data from EEPROM and display it on screen
56+
display.display();
5357
}
5458

5559
void loop()
@@ -85,12 +89,15 @@ void printEEPROM()
8589
// Go through each address and read a value from it
8690
for (int i = 0; i < EEPROM_SIZE; i++)
8791
{
88-
// Print read value in decimal
92+
// Print read value in decimal
8993
display.print(EEPROM.read(i), DEC);
94+
Serial.print(EEPROM.read(i));
9095

9196
// Print a comma after each number except the last one
9297
if (i != EEPROM_SIZE - 1)
98+
{
9399
display.print(", ");
100+
Serial.print(", ");
101+
}
94102
}
95-
display.partialUpdate();
96103
}

examples/Inkplate4/Advanced/Other/Inkplate4_Read_Battery_Voltage/Inkplate4_Read_Battery_Voltage.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ void loop()
3434
{
3535
float voltage = display.readBattery(); // Read battery voltage
3636
display.clearDisplay(); // Clear everything in frame buffer of e-paper display
37-
display.drawImage(battSymbol, 100, 100, 106, 45, BLACK); // Draw battery symbol at position X=100 Y=100
38-
display.setCursor(210, 120);
37+
display.drawImage(battSymbol, 100, 100, 104, 104, BLACK); // Draw battery symbol at position X=100 Y=100
38+
display.setCursor(220, 140);
3939
display.print(voltage, 2); // Print battery voltage
4040
display.print('V');
4141
display.display(); // Send everything to display (refresh the screen)

0 commit comments

Comments
 (0)