Skip to content

Commit c050808

Browse files
committed
Some correction on Inkplate5 examples and autoformatting all examples
1 parent b81aaeb commit c050808

File tree

20 files changed

+101
-86
lines changed

20 files changed

+101
-86
lines changed

examples/Inkplate5/Advanced/Communications/Inkplate5_Bluetooth_Peripheral_Mode/Inkplate5_Bluetooth_Peripheral_Mode.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
77
88
This example shows how to use Inkplate as a peripheral device over Bluetooth.
9+
Upload this example to the Inkplate and connect your phone to it via Bluetooth.
10+
First, you have to pair the Inkplate with your phone in Bluetooth settings in your phone, then go to the
11+
Serial Bluetooth Terminal app and you can find the Inkplate in the device list. You can use another similar app.
12+
If Bluetooth starts successfully, you can send commands from your phone.
913
1014
Want to learn more about Inkplate? Visit www.inkplate.io
1115
Looking to get support? Write on our forums: https://forum.soldered.com/
@@ -18,8 +22,8 @@
1822
#endif
1923

2024
// Include Inkplate and BluetoothSerial library to the sketch
21-
#include "Inkplate.h"
2225
#include "BluetoothSerial.h"
26+
#include "Inkplate.h"
2327

2428
#include "Peripheral.h"
2529

examples/Inkplate5/Advanced/Communications/Inkplate5_Bluetooth_Serial/Inkplate5_Bluetooth_Serial.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const char *btDeviceName = "Inkplate5";
3333
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1-bit mode (BW)
3434
BluetoothSerial SerialBT; // Create SerialBT object for Bluetooth communication
3535

36-
// Font scale for the text on the screen. The scale of 1 is 7px height
36+
// Font scale for the text on the screen
3737
#define BIG_TEXT_SCALE 4
3838
#define SMALL_TEXT_SCALE 3
3939

examples/Inkplate5/Advanced/Communications/Inkplate5_EasyC/Inkplate5_EasyC.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
Inkplate5_easyC example for Soldered Inkplate 5
33
For this example you will need USB cable, Inkplate 5,
4-
BME680 sensor with easyC connector on it: https://soldered.com/product/enviromental-air-quality-sensor-bme680-breakout/
5-
and a easyC cable: https://soldered.com/product/easyc-cable-20cm/
6-
Select "Soldered Inkplate5" from Tools -> Board menu.
4+
BME680 sensor with easyC connector on it: https://soldered.com/product/enviromental-air-quality-sensor-bme680-breakout/
5+
and a easyC cable: https://soldered.com/product/easyc-cable-20cm/
6+
Select "Soldered Inkplate5" from Tools -> Board menu.
77
Don't have "Soldered Inkplate5" option? Follow our tutorial and add it:
88
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
99
@@ -37,12 +37,12 @@ void setup()
3737
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
3838
display.clearDisplay(); // Clear frame buffer of display
3939
display.display(); // Put clear image on display
40-
40+
4141
// Init BME680 library. Soldered BME680 sensor board uses 0x76 I2C address for the sensor but doesn't need to
4242
// specify it
4343
if (!bme680.begin())
4444
{
45-
display.setTextSize(2); // Set text scaling to two (text will be two times bigger than normal)
45+
display.setTextSize(2); // Set text scaling to two (text will be two times bigger than normal (5x7 px))
4646
display.println("Sensor init failed!");
4747
display.println("Check sensor wiring/connection!");
4848
display.partialUpdate();
@@ -87,7 +87,7 @@ void loop()
8787

8888
// This part of code actually drawing on the Inkplate screen, previous lines just drawing into the frame buffer
8989
// Check if you need to do full refresh or you can do partial update
90-
if(n > 20)
90+
if (n > 20)
9191
{
9292
// Do a full refresh
9393
display.display();
@@ -98,7 +98,7 @@ void loop()
9898
display.partialUpdate(); // Do partial update
9999
n++; // Keep track on how many times screen has been partially updated
100100
}
101-
101+
102102
// Wait a little bit between readings
103103
delay(10000);
104104
}

examples/Inkplate5/Advanced/DeepSleep/Inkplate5_Partial_Update_With_Deep_Sleep/Inkplate5_Partial_Update_With_Deep_Sleep.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#error "Wrong board selection for this example, please select Soldered Inkplate5 in the boards menu."
2626
#endif
2727

28-
#include "Inkplate.h" // Include Inkplate library to the sketch
29-
#include <rom/rtc.h> // Include ESP32 library for RTC (needed for rtc_get_reset_reason() function)
28+
#include "Inkplate.h" // Include Inkplate library to the sketch
29+
#include <rom/rtc.h> // Include ESP32 library for RTC (needed for rtc_get_reset_reason() function)
3030

3131
#define uS_TO_S_FACTOR 1000000 // Conversion factor for micro seconds to seconds
3232
#define TIME_TO_SLEEP 10 // Time how long ESP32 will be in deep sleep (in seconds). In this case 10 seconds.

examples/Inkplate5/Advanced/DeepSleep/Inkplate5_RTC_Alarm_With_Deep_Sleep/Inkplate5_RTC_Alarm_With_Deep_Sleep.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ void setup()
4040
}
4141

4242
// Display current time and date
43-
printCurrentTime();
43+
printCurrentTime();
4444
display.display();
4545

4646
// Set RTC alarm 10 seconds from now
47-
display.rtcSetAlarmEpoch(display.rtcGetEpoch() + 10, RTC_ALARM_MATCH_DHHMMSS);
47+
display.rtcSetAlarmEpoch(display.rtcGetEpoch() + 10, RTC_ALARM_MATCH_DHHMMSS);
4848

4949
// Enable wakup from deep sleep on gpio 39 where RTC interrupt is connected
5050
esp_sleep_enable_ext0_wakeup(GPIO_NUM_39, 0);

examples/Inkplate5/Advanced/DeepSleep/Inkplate5_Simple_Deep_Sleep/Inkplate5_Simple_Deep_Sleep.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#error "Wrong board selection for this example, please select Soldered Inkplate5 in the boards menu."
2323
#endif
2424

25-
#include "Inkplate.h" // Include Inkplate library to the sketch
26-
#include "picture1.h" // Include .h files of 3 pictures. All three pictures were converted using Inkplate Image Converter
25+
#include "Inkplate.h" // Include Inkplate library to the sketch
26+
#include "picture1.h" // Include .h files of 3 pictures. All three pictures were converted using Inkplate Image Converter
2727
#include "picture2.h"
2828
#include "picture3.h"
2929
const uint8_t *pictures[] = {pic1, pic2, pic3}; // This array of pinters holds address of every picture in the memory,
@@ -39,10 +39,10 @@ void setup()
3939
{
4040
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
4141
display.clearDisplay(); // Clear frame buffer of display
42-
display.drawImage(
43-
pictures[slide], 0, 0, E_INK_WIDTH,
44-
E_INK_HEIGHT); // Display selected picture at location X=0, Y=0. All three pictures have resolution of 960x540 pixels
45-
display.display(); // Refresh the screen with new picture
42+
display.drawImage(pictures[slide], 0, 0, E_INK_WIDTH,
43+
E_INK_HEIGHT); // Display selected picture at location X=0, Y=0. All three pictures have
44+
// resolution of 960x540 pixels
45+
display.display(); // Refresh the screen with new picture
4646
slide++; // Update counter for pictures. With this variable, we choose what picture is going to be displayed on
4747
// screen
4848
if (slide > 2)

examples/Inkplate5/Advanced/IO/Inkplate5_Internal_IO_Expander/Inkplate5_Internal_IO_Expander.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
panel and TPS65186 PMIC.
1515
P1-0 is used for ESP32 GPIO0 so you can't use it either.
1616
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 pad).
18-
If everything is connected ok, after you upload code, LED should blink.
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.
1919
2020
DANGER: DO NOT USE P0-0 -> P0-7 and P1-0. In code those are pins from 0-8!!! Using those, you
2121
might permanently damage the screen. You should only use pins from 9-15.
@@ -43,7 +43,7 @@ void setup()
4343
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
4444
display.pinModeIO(LED_PIN, OUTPUT,
4545
IO_INT_ADDR); // Set P1-7 to output. On that pin, we sholud connect LED with current
46-
// limiting resistor and specify that we want use internal IO expander
46+
// limiting resistor and specify that we want use internal IO expander
4747
}
4848

4949
void loop()

examples/Inkplate5/Advanced/Other/Inkplate5_Read_Battery_Voltage/Inkplate5_Read_Battery_Voltage.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#error "Wrong board selection for this example, please select Soldered Inkplate5 in the boards menu."
1818
#endif
1919

20-
#include "Inkplate.h" //Include Inkplate library to the sketch
21-
#include "battSymbol.h" //Include .h file that contains byte array for battery symbol.
20+
#include "Inkplate.h" // Include Inkplate library to the sketch
21+
#include "battSymbol.h" // Include .h file that contains byte array for battery symbol.
2222
// It is in same folder as this sketch. You can even open it (read it) by clicking on battSymbol.h tab in Arduino IDE
2323
Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and also set library into 1-bit mode (BW)
2424

examples/Inkplate5/Advanced/Other/Inkplate5_Read_Temperature/Inkplate5_Read_Temperature.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void loop()
3636
{
3737
int temperature = display.readTemperature(); // Read temperature from on-board temperature sensor
3838
display.clearDisplay(); // Clear everything in frame buffer of e-paper display
39-
display.drawImage(tempSymbol, 100, 100, 38, 79, BLACK); // Draw temperature symbol at position X=100, Y=200
39+
display.drawImage(tempSymbol, 100, 100, 38, 79, BLACK); // Draw temperature symbol at position X=100, Y=100
4040
display.setCursor(150, 125);
4141
display.print(temperature, DEC); // Print temperature
4242
display.print('C');

examples/Inkplate5/Advanced/RTC/Inkplate5_RTC_Alarm/Inkplate5_RTC_Alarm.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ void printTime(uint8_t _hour, uint8_t _minutes, uint8_t _seconds, uint8_t _day,
121121
display.print(_year, DEC);
122122
}
123123

124+
// A function that prints 2 digits
125+
// It adds 0 before the number if it's only one digit
124126
void print2Digits(uint8_t _d)
125127
{
126128
if (_d < 10)

0 commit comments

Comments
 (0)