Skip to content

Commit 8d708f3

Browse files
authored
Merge pull request #215 from SolderedElectronics/dev
Dev to master, library update.
2 parents 3f1908e + cc9a0cd commit 8d708f3

File tree

963 files changed

+211672
-2892
lines changed

Some content is hidden

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

963 files changed

+211672
-2892
lines changed

.github/workflows/compile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
fqbn: ${{ matrix.board.fqbn }}
5656
libraries: |
5757
- source-path: ./
58-
- name: "Adafruit BME680 Library"
5958
- name: ArduinoJson
6059
- name: Time
6160
- source-url: https://github.com/SolderedElectronics/Soldered-MFRC522-RFID-Reader-Arduino-Library.git

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ pip3 install pyserial
5353
apt install python-is-python3
5454
```
5555

56+
In case you're getting an [error](https://github.com/SolderedElectronics/Inkplate-Arduino-library/issues/212) while trying to install pyserial, run the following command:
57+
58+
```
59+
apt install python3-serial
60+
```
61+
5662
### Micropython
5763

5864
If you are looking for micropython support, please find all details [here](https://github.com/SolderedElectronics/Inkplate-micropython).

examples/Inkplate10/Advanced/Communications/Inkplate10_EasyC/Inkplate10_EasyC.ino

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

25-
#include "BME680-SOLDERED.h" // Soldered library for BME680 Sensor
25+
#include <BME680-SOLDERED.h> // Soldered library for BME680 Sensor
2626
#include "Inkplate.h" // Include Inkplate library to the sketch
2727
#include "icons.h"
2828

@@ -32,6 +32,9 @@ BME680 bme680; // Create an object on Soldered BME680 library (with no arguments
3232

3333
int n = 0; // Variable that keep track on how many times screen has been partially updated
3434

35+
// Add temperature offset to calibrate the sensor
36+
const float temperatureOffset = 0.0;
37+
3538
void setup()
3639
{
3740
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
@@ -59,7 +62,7 @@ void loop()
5962

6063
// Display the temperature icon and measured value
6164
display.setCursor(493, 65);
62-
display.print(bme680.readTemperature());
65+
display.print(bme680.readTemperature() + temperatureOffset);
6366
display.print(" *C");
6467
display.drawImage(temperature_icon, 220, 40, temperature_icon_w, temperature_icon_h,
6568
BLACK); // Arguments are: array variable name, start X, start Y, size X, size Y, color
@@ -99,4 +102,7 @@ void loop()
99102

100103
// Wait a little bit between readings
101104
delay(10000);
105+
106+
// If you want to save energy, instead of the delay function, you can use deep sleep as we used in DeepSleep
107+
// examples
102108
}

examples/Inkplate10/Advanced/RTC/Inkplate10_RTC_Alarm/Inkplate10_RTC_Alarm.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ uint8_t hour = 12;
3232
uint8_t minutes = 50;
3333
uint8_t seconds = 30;
3434

35-
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 menas Monday, ...)
35+
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 means Monday, ...)
3636
uint8_t weekday = 1;
3737
uint8_t day = 20;
3838
uint8_t month = 2;

examples/Inkplate10/Advanced/RTC/Inkplate10_RTC_Simple/Inkplate10_RTC_Simple.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ uint8_t hour = 12;
3232
uint8_t minutes = 50;
3333
uint8_t seconds = 30;
3434

35-
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 menas Monday, ...)
35+
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 means Monday, ...)
3636
uint8_t weekday = 4;
3737
uint8_t day = 11;
3838
uint8_t month = 11;

examples/Inkplate10/Advanced/RTC/Inkplate10_RTC_Timer/Inkplate10_RTC_Timer.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ uint8_t hour = 12;
2828
uint8_t minutes = 50;
2929
uint8_t seconds = 30;
3030

31-
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 menas Monday, ...)
31+
// Set date and weekday (NOTE: In weekdays 0 means Sunday, 1 means Monday, ...)
3232
uint8_t weekday = 4;
3333
uint8_t day = 11;
3434
uint8_t month = 11;
@@ -44,7 +44,7 @@ void setup()
4444
display.display(); // Put clear image on display
4545
display.setTextSize(5); // Set text to be 5 times bigger than classic 5x7 px text
4646

47-
pinMode(39, INPUT_PULLUP);
47+
pinMode(39, INPUT_PULLUP); // Set RTC INT pin on ESP32 GPIO39 as input with pullup resistor enabled
4848

4949
display.rtcSetTime(hour, minutes, seconds); // Send time to RTC
5050
display.rtcSetDate(weekday, day, month, year); // Send date to RTC
@@ -62,7 +62,7 @@ void setup()
6262
* int_pulse
6363
* true = interrupt generate a pulse; false = interrupt follows timer flag
6464
*/
65-
display.rtcTimerSet(Inkplate::TIMER_CLOCK_1HZ, countdown_time, false, false);
65+
display.rtcTimerSet(Inkplate::TIMER_CLOCK_1HZ, countdown_time, true, false);
6666
}
6767

6868
// Variable that keeps count on how much screen has been partially updated

examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_Show_JPG_With_HTTPClient/Inkplate10_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Inkplate display(INKPLATE_1BIT);
3232
char *ssid = ""; // Your WiFi SSID
3333
char *pass = ""; // Your WiFi password
3434

35-
// Optionally
35+
// Add the URL of the image you want to show on Inkplate
3636
String url = "https://raw.githubusercontent.com/SolderedElectronics/Inkplate-Arduino-library/dev/examples/Inkplate10/Advanced/WEB_WiFi/Inkplate10_Show_JPG_With_HTTPClient/image.jpg";
3737

3838
/***********************************************/

examples/Inkplate10/Diagnostics/Inkplate10_Factory_Programming_VCOM/Inkplate10_Factory_Programming_VCOM.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* Tests will also be done, to pass all tests:
1515
* - Edit the WiFi information in test.cpp.
16-
* - Connect a slave device via EasyC on address 0x28 (you may change this in test.cpp also).
16+
* - Connect a slave device via EasyC on address 0x30 (you may change this in test.cpp also).
1717
* In the InkplateEasyCTester folder, you can find the code for uploading to Dasduino Core
1818
* or Dasduino ConnectPlus to convert Dasduino to an I2C slave device for testing an easyC connector
1919
* if you don't have a device with address 0x30.

examples/Inkplate10/Diagnostics/Inkplate10_RTC_Calibration/Inkplate10_RTC_Calibration.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Inkplate display(INKPLATE_1BIT); // Create an object on Inkplate library and als
2626
#define REFRESH_DELAY 1000 // Delay between refreshes
2727
unsigned long time1; // Time for measuring refresh in millis
2828

29+
#define MAX_PARTIAL_UPDATES 9 // How many partial updates to do before a full refresh
30+
2931
// Variable that keeps count on how much screen has been partially updated
3032
int n = 0;
3133

@@ -60,7 +62,6 @@ void setup()
6062
// The real offset depends on the mode and it is equal to the: offset in ppm for specific mode * offset value in
6163
// decimal. For example: mode 0 (4.34 ppm), offset value 15 = + 65.1 ppm every 2 hours
6264
// See 8.2.3 in the datasheet for more details
63-
6465
display.rtcSetClockOffset(1, -63);
6566

6667
// How to calculate this offset?
@@ -126,7 +127,7 @@ void loop()
126127
display.setCursor(480, 380); // Set position of the text
127128
printTime(hours, minutes, seconds); // Print the time on screen
128129

129-
if (n > 9) // Check if you need to do full refresh or you can do partial update
130+
if (n > MAX_PARTIAL_UPDATES) // Check if you need to do full refresh or you can do partial update
130131
{
131132
display.display(true); // Do a full refresh
132133
n = 0;

examples/Inkplate10/Projects/Inkplate10_Google_Calendar/Inkplate10_Google_Calendar.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ void setup()
106106
display.setTextWrap(false);
107107
display.setTextColor(0, 7);
108108

109-
delay(5000);
110-
network.begin();
109+
// Connect Inkplate to the WiFi network
110+
network.begin(ssid, pass);
111111

112-
// Keep trying to get data if it fails the first time
113-
Serial.print("Failed getting data, retrying");
114-
while (!network.getData(data))
112+
// Get the data from Google Calendar
113+
// Repeat attempts until data is fully downloaded
114+
Serial.println("Getting data... ");
115+
while (!network.getData(calendarURL, data))
115116
{
116-
Serial.print('.');
117117
delay(1000);
118118
}
119119

@@ -375,7 +375,7 @@ bool drawEvent(entry *event, int day, int beginY, int maxHeigth, int *heigthNeed
375375
// Gets text bounds
376376
display.getTextBounds(line, 0, 0, &xt1, &yt1, &w, &h);
377377

378-
if (w > (1200 / 3))
378+
if (w > (800 / 3))
379379
{
380380
for (int j = i - 1; j > max(-1, i - 4); --j)
381381
line[j] = '.';
@@ -442,12 +442,12 @@ void drawData()
442442
char *timeStart = strstr(data + i, "DTSTART:") + 8;
443443
char *timeEnd = strstr(data + i, "DTEND:") + 6;
444444

445-
if (summary && summary < end)
445+
if (summary && summary < end && (summary - data) > 0)
446446
{
447447
strncpy(entries[entriesNum].name, summary, strchr(summary, '\n') - summary);
448448
entries[entriesNum].name[strchr(summary, '\n') - summary] = 0;
449449
}
450-
if (location && location < end)
450+
if (location && location < end && (location - data) > 0)
451451
{
452452
strncpy(entries[entriesNum].location, location, strchr(location, '\n') - location);
453453
entries[entriesNum].location[strchr(location, '\n') - location] = 0;

0 commit comments

Comments
 (0)