Skip to content

Commit 2d44c59

Browse files
authored
Merge pull request #156 from e-radionicacom/dev
Added Inkplate 6 Color Factory Programming Example
2 parents 9132d97 + f481b5d commit 2d44c59

File tree

939 files changed

+241402
-179374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

939 files changed

+241402
-179374
lines changed

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Battery_Voltage_And_Temperature/Inkplate_Battery_Voltage_And_Temperature.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
// It is in same folder as this sketch. You can even open it (read it) by clicking on symbols.h tab in Arduino IDE
2626
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1-bit mode (BW)
2727

28+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
29+
// otherwise your code could hang out when you send code to your Inkplate.
30+
// You can easily check if your Inkplate has second MCP by turning it over and
31+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
32+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
33+
2834
void setup()
2935
{
3036
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Bluetooth_Peripheral_Mode_Example/Inkplate_Bluetooth_Peripheral_Mode_Example.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ BluetoothSerial SerialBT;
2727
// Temporary buffer to send to Peripheral mode code
2828
char commandBuffer[BUFFER_SIZE + 1];
2929

30+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
31+
// otherwise your code could hang out when you send code to your Inkplate.
32+
// You can easily check if your Inkplate has second MCP by turning it over and
33+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
34+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
35+
3036
void setup() // Initialize everything
3137
{
3238
Serial.begin(115200);

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_EEPROM_Usage/Inkplate_EEPROM_Usage.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828

2929
Inkplate display(INKPLATE_1BIT); // Create object on Inkplate library and set library to work in monochrome mode
3030

31+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
32+
// otherwise your code could hang out when you send code to your Inkplate.
33+
// You can easily check if your Inkplate has second MCP by turning it over and
34+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
35+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
36+
3137
void setup()
3238
{
3339
display.begin(); // Init library (you should call this function ONLY ONCE)

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_EasyC/Inkplate_EasyC.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ Adafruit_BME680
3333
//(with no arguments sent to constructor, that means we are using I2C communication for BME680 sensor)
3434

3535
int n = 0; // Variable that keep track on how many times screen has been partially updated
36+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
37+
// otherwise your code could hang out when you send code to your Inkplate.
38+
// You can easily check if your Inkplate has second MCP by turning it over and
39+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
40+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
41+
3642
void setup()
3743
{
3844
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Faster_Display/Inkplate_Faster_Display.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
// beware it doesn't support partialUpdate yet
2020
Inkplate display(INKPLATE_1BIT);
2121

22+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
23+
// otherwise your code could hang out when you send code to your Inkplate.
24+
// You can easily check if your Inkplate has second MCP by turning it over and
25+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
26+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
27+
2228
void setup()
2329
{
2430
// Initialize the display and serial

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Low_Power/Inkplate_Low_Power.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ RTC_DATA_ATTR int slide = 0;
3737

3838
Inkplate display(INKPLATE_3BIT); // Create an object on Inkplate library and also set library into 3 Bit mode (gray)
3939

40+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
41+
// otherwise your code could hang out when you send code to your Inkplate.
42+
// You can easily check if your Inkplate has second MCP by turning it over and
43+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
44+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
45+
4046
void setup()
4147
{
4248
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_MCP23017_Expander/Inkplate_MCP23017_Expander.ino

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@
99
You will have to connect one side of 330 Ohm resistor to GPB7, than other side to anode of LED and finally, cathode
1010
pin of LED to GND.
1111
12-
This example will show you how you can manipulate with I/Os of MCP23017 Expander.
13-
You can only manipulate with Port B of MCP23017 (GPB1-GPB7). Port A is used for epaper panel and TPS65186 PMIC.
14-
GPB0 is used for ESP32 GPIO0 so you can't use it either.
15-
GPB1 is used for enabling battery reading (if Batt solder bridge is bridged between second and third pad)
16-
GPB2, GPB3 and GPB4 are used for reading touchpad (if Touchpad solder bridges are bridged between second pad and
17-
third pad). If every thing is connected ok, after you upload code, LED should blink.
18-
19-
DANGER: DO NOT USE GPA0-GPA7 and GPB0. In code those are pins from 0-8!!! Using those, you might permanently damage
20-
the screen. You should only use pins from 9-15.
12+
This example will show you how you can manipulate with I/Os of external MCP23017 Expander.
13+
On this expander all pins are free to use, nothing is connected by the default.
2114
2215
Want to learn more about Inkplate? Visit www.inkplate.io
2316
Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
@@ -41,7 +34,9 @@ void setup()
4134
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
4235
display.pinModeMCP(
4336
LED_PIN,
44-
OUTPUT); // Set pin 15 (or GPB7) to output. On that pin, we sholud connect LED with current limiting resistor
37+
OUTPUT); // Set pin 15 (or GPB7) to output. On that pin, we sholud connect LED with current limiting resistor
38+
// If we do not specify which MCP we want to use, by the default external MCP will be used of the one
39+
// with header named MCP23017-2
4540
}
4641

4742
void loop()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
Inkplate_MCP23017 example for e-radionica.com Inkplate 10
3+
For this example you will need only a micro USB cable, Inkplate10, 330 Ohm resistor and LED diode.
4+
Select "Inkplate 10(ESP32)" from Tools -> Board menu.
5+
Don't have "Inkplate 10(ESP32)" option? Follow our tutorial and add it:
6+
https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
7+
8+
Connect resistor to GPB7 pin on MCP23017 header at bottom right corner on the backside (component side) of Inkplate.
9+
You will have to connect one side of 330 Ohm resistor to GPB7, than other side to anode of LED and finally, cathode
10+
pin of LED to GND.
11+
12+
This example will show you how you can manipulate with I/Os of internal MCP23017 Expander.
13+
You can only manipulate with Port B of MCP23017 (GPB1-GPB7). Port A is used for epaper panel and TPS65186 PMIC.
14+
GPB0 is used for ESP32 GPIO0 so you can't use it either.
15+
GPB1 is used for enabling battery reading (if Batt solder bridge is bridged between second and third pad)
16+
GPB2, GPB3 and GPB4 are used for reading touchpad (if Touchpad solder bridges are bridged between second pad and
17+
third pad). If every thing is connected ok, after you upload code, LED should blink.
18+
19+
DANGER: DO NOT USE GPA0-GPA7 and GPB0. In code those are pins from 0-8!!! Using those, you might permanently damage
20+
the screen. You should only use pins from 9-15.
21+
22+
Want to learn more about Inkplate? Visit www.inkplate.io
23+
Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
24+
19 May 2022 by Soldered.com
25+
*/
26+
27+
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
28+
#ifndef ARDUINO_INKPLATE10
29+
#error "Wrong board selection for this example, please select Inkplate 10 in the boards menu."
30+
#endif
31+
32+
#include "Inkplate.h" //Include Inkplate library to the sketch
33+
34+
#define LED_PIN MCP23017_PIN_B7 // We are going to use pin GPB7 (remember! GPA0 = 0, GPA1 = 1, ..., GPA7 = 7, GPB0 = 8, GBP1 = 9, ..., GPB7 =
35+
// 15)
36+
37+
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1-bit mode (BW)
38+
39+
void setup()
40+
{
41+
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
42+
display.pinModeMCP(
43+
LED_PIN,
44+
OUTPUT, MCP23017_INT_ADDR); // Set pin 15 (or GPB7) to output. On that pin, we sholud connect LED with current limiting resistor
45+
// and specify that we want use internal MCP or MCP with header named MCP23017-1
46+
}
47+
48+
void loop()
49+
{
50+
display.digitalWriteMCP(LED_PIN, LOW, MCP23017_INT_ADDR); // Set output to low (LED does not light up)
51+
delay(1000); // Wait for one second
52+
display.digitalWriteMCP(LED_PIN, HIGH, MCP23017_INT_ADDR); // Set output to high (LED lights up)
53+
delay(1000); // Wait for one second
54+
}

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Partial_Update_With_Deep_Sleep/Inkplate_Partial_Update_With_Deep_Sleep.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and als
4040
RTC_DATA_ATTR int counter = 0;
4141
RTC_DATA_ATTR float decimal = PI;
4242

43+
// If your Inkplate doesn't have external (or second) MCP I/O expander, you should uncomment next line,
44+
// otherwise your code could hang out when you send code to your Inkplate.
45+
// You can easily check if your Inkplate has second MCP by turning it over and
46+
// if there is missing chip near place where "MCP23017-2" is written, but if there is
47+
// chip soldered, you don't have to uncomment line and use external MCP I/O expander
48+
4349
void setup()
4450
{
4551
Serial.begin(115200);
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
Inkplate_Picture_From_RAM example for soldered.com Inkplate 10
3+
For this example you will need USB cable and Inkplate 10.
4+
Select "Inkplate 10(ESP32)" from Tools -> Board menu.
5+
Don't have "Inkplate 10(ESP32)" option? Follow our tutorial and add it:
6+
https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
7+
8+
This example will show you how you can show picture loaded in RAM.
9+
Inkplate can show picture in 1-bit or 3-bit mode.
10+
Inkplate will wake every 20 seconds change content on screen.
11+
12+
Want to learn more about Inkplate? Visit www.inkplate.io
13+
Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
14+
13 June 2022 by soldered.com
15+
*/
16+
17+
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
18+
#ifndef ARDUINO_INKPLATE10
19+
#error "Wrong board selection for this example, please select Inkplate 10 in the boards menu."
20+
#endif
21+
22+
#include "Inkplate.h" // Include Inkplate library to the sketch
23+
#include "picture1.h" // Include .h files of 3 pictures. All three pictures were converted using Inkplate Image Converter
24+
#include "picture2.h"
25+
#include "picture3.h" // This are headers in which are saved pictures that needs to be stored in RAM for showing.
26+
// Any picture (in any format) can be converted in this type of header on this link:
27+
// https://inkplate.io/home/image-converter/ just choose settings for your Inkplate
28+
// and additional settings like dither and bit mode.
29+
30+
Inkplate display(INKPLATE_3BIT); // Create an object on Inkplate library and also set library into 3 Bit mode (gray)
31+
32+
void setup()
33+
{
34+
Serial.begin(115200);
35+
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
36+
display.clearDisplay(); // Clear frame buffer of display
37+
38+
display.drawImage(
39+
picture1, 50, 0, 1100,
40+
825); // Display picture from RAM at location X=50, Y=0. It is also needed to specify width and height
41+
// of picture (1100x825 in this case). drawImage function iis overloaded function and this parameters
42+
// specify to use function which draws image on screen from internal RAM and this function calls other
43+
// functions (drawBitmap or drawBitmap3Bit depends in which mode is Inkplate (INKPLATE_3BIT or INKPLATE_1BIT))
44+
// which draws content from buffer in RAM.
45+
display.display(); // Refresh the screen with new picture
46+
47+
delay(10000); // Wait a bit
48+
49+
display.clearDisplay(); // Clear frame buffer of display
50+
51+
display.drawBitmap3Bit(
52+
50, 0, picture2, 1100,
53+
825); // This function is called automatically from drawImage if first parameter is
54+
// pointer to buffer in which picture is stored and Inkplate is in 3-bit mode.
55+
// In this example we are using this function only to show it's functionality
56+
// and to show that this function can be used if you have problems with showing
57+
// 3-bit pictures on Inkplate.
58+
59+
display.display(); // Refresh the screen with new picture
60+
61+
delay(10000); // Wait a bit
62+
63+
display.clearDisplay(); // Clear frame buffer of display
64+
65+
display.drawBitmap3Bit(
66+
50, 0, picture3, 1100,
67+
825); // Display selected picture at location X=0, Y=0. All three pictures have resolution of 1100x825 pixels
68+
69+
display.display(); // Refresh the screen with new picture
70+
}
71+
72+
void loop()
73+
{
74+
// Nothing! If you use deep sleep, whole program should be in setup() because each time the board restarts, not in a
75+
// loop()! loop() must be empty!
76+
}

0 commit comments

Comments
 (0)