Skip to content

Commit 595d92d

Browse files
apply fix v6
1 parent acc6c5b commit 595d92d

File tree

5 files changed

+57
-57
lines changed

5 files changed

+57
-57
lines changed

examples/Inkplate4TEMPERA/Advanced/Communication/Inkplate4TEMPERA_Bluetooth_Peripheral_Mode/Peripheral.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
210210
r = display->sdCardInit();
211211
if (r)
212212
{
213-
r = display->drawBitmapFromSd(strTemp, x, y);
213+
r = display->image.drawBitmapFromSd(strTemp, x, y);
214214
SerialBT->print("#H(");
215215
SerialBT->print(r, DEC);
216216
SerialBT->println(")*");
@@ -355,7 +355,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
355355
r = display->sdCardInit();
356356
if (r)
357357
{
358-
r = display->drawImage(strTemp, x, y);
358+
r = display->image.draw(strTemp, x, y);
359359
SerialBT->print("#H(");
360360
SerialBT->print(r, DEC);
361361
SerialBT->println(")*");
@@ -392,26 +392,26 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
392392
sscanf(s + 3, "%d,%d,%d", &hr, &min, &sec);
393393
// sprintf(temp, "display->rtcSetTime(%d, %d, %d);\n\r", hr, min, sec);
394394
// SerialBT->println(temp);
395-
display->rtcSetTime(hr, min, sec);
395+
display->rtc.SetTime(hr, min, sec);
396396
break;
397397
case 'X':
398398
sscanf(s + 3, "%d,%d,%d,%d", &wday, &day, &mon, &yr);
399399
// sprintf(temp, "display->rtcSetDate(%d, %d, %d, %d);\n\r", wday, day, mon, yr);
400400
// SerialBT->println(temp);
401-
display->rtcSetDate(wday, day, mon, yr);
401+
display->rtc.SetDate(wday, day, mon, yr);
402402
break;
403403
case 'Y':
404404
sscanf(s + 3, "%d", &ep);
405405
// sprintf(temp, "display->rtcSetEpoch(%d);\n\r", ep);
406406
// SerialBT->println(temp);
407-
display->rtcSetEpoch(ep);
407+
display->rtc.SetEpoch(ep);
408408
break;
409409
case 'Z':
410410
sscanf(s + 3, "%c", &b);
411411
if (b == '?')
412412
{
413413
SerialBT->print("#Z(");
414-
SerialBT->print(display->rtcGetEpoch());
414+
SerialBT->print(display->rtc.GetEpoch());
415415
SerialBT->println(")*");
416416
SerialBT->flush();
417417
}
@@ -423,30 +423,30 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
423423
SerialBT->println("INVALID");
424424
break;
425425
}
426-
display->rtcGetRtcData();
426+
display->rtc.GetRtcData();
427427
SerialBT->print("#a(");
428428
switch (k)
429429
{
430430
case 0:
431-
SerialBT->print(display->rtcGetSecond());
431+
SerialBT->print(display->rtc.GetSecond());
432432
break;
433433
case 1:
434-
SerialBT->print(display->rtcGetMinute());
434+
SerialBT->print(display->rtc.GetMinute());
435435
break;
436436
case 2:
437-
SerialBT->print(display->rtcGetHour());
437+
SerialBT->print(display->rtc.GetHour());
438438
break;
439439
case 3:
440-
SerialBT->print(display->rtcGetDay());
440+
SerialBT->print(display->rtc.GetDay());
441441
break;
442442
case 4:
443-
SerialBT->print(display->rtcGetWeekday());
443+
SerialBT->print(display->rtc.GetWeekday());
444444
break;
445445
case 5:
446-
SerialBT->print(display->rtcGetMonth());
446+
SerialBT->print(display->rtc.GetMonth());
447447
break;
448448
case 6:
449-
SerialBT->print(display->rtcGetYear());
449+
SerialBT->print(display->rtc.GetYear());
450450
break;
451451
}
452452
SerialBT->println(")*");
@@ -456,20 +456,20 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
456456
sscanf(s + 3, "%d,%d,%d,%d,%d", &as, &am, &ah, &ad, &aw);
457457
// sprintf(temp, "display->rtcSetAlarm(%d, %d, %d, %d, %d);\n\r", as, am, ah, ad, aw);
458458
// SerialBT->println(temp);
459-
display->rtcSetAlarm(as, am, ah, ad, aw);
459+
display->rtc.SetAlarm(as, am, ah, ad, aw);
460460
break;
461461
case 'c':
462462
sscanf(s + 3, "%d,%d", &ae, &amc);
463463
// sprintf(temp, "display->rtcSetAlarmEpoch(%d, %d);\n\r", ae, amc);
464464
// SerialBT->println(temp);
465-
display->rtcSetAlarmEpoch(ae, amc);
465+
display->rtc.SetAlarmEpoch(ae, amc);
466466
break;
467467
case 'd':
468468
sscanf(s + 3, "%c", &b);
469469
if (b == '?')
470470
{
471471
SerialBT->print("#d(");
472-
SerialBT->print(display->rtcCheckAlarmFlag());
472+
SerialBT->print(display->rtc.CheckAlarmFlag());
473473
SerialBT->println(")*");
474474
SerialBT->flush();
475475
}
@@ -479,7 +479,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
479479
if (b == '1')
480480
{
481481
// SerialBT->println("display->rtcClearAlarmFlag()");
482-
display->rtcClearAlarmFlag();
482+
display->rtc.ClearAlarmFlag();
483483
SerialBT->flush();
484484
}
485485
break;
@@ -494,19 +494,19 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
494494
switch (k)
495495
{
496496
case 0:
497-
SerialBT->print(display->rtcGetAlarmSecond());
497+
SerialBT->print(display->rtc.GetAlarmSecond());
498498
break;
499499
case 1:
500-
SerialBT->print(display->rtcGetAlarmMinute());
500+
SerialBT->print(display->rtc.GetAlarmMinute());
501501
break;
502502
case 2:
503-
SerialBT->print(display->rtcGetAlarmHour());
503+
SerialBT->print(display->rtc.GetAlarmHour());
504504
break;
505505
case 3:
506-
SerialBT->print(display->rtcGetAlarmDay());
506+
SerialBT->print(display->rtc.GetAlarmDay());
507507
break;
508508
case 4:
509-
SerialBT->print(display->rtcGetAlarmWeekday());
509+
SerialBT->print(display->rtc.GetAlarmWeekday());
510510
break;
511511
}
512512
SerialBT->println(")*");
@@ -523,14 +523,14 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
523523

524524
// sprintf(temp, "display->rtcTimerSet(%d, %d, %d, %d);\n\r", sc, v, ie, ip);
525525
// SerialBT->println(temp);
526-
display->rtcTimerSet(sc, v, ie, ip);
526+
display->rtc.TimerSet(sc, v, ie, ip);
527527
break;
528528
case 'h':
529529
sscanf(s + 3, "%c", &b);
530530
if (b == '?')
531531
{
532532
SerialBT->print("#h(");
533-
SerialBT->print(display->rtcCheckTimerFlag());
533+
SerialBT->print(display->rtc.CheckTimerFlag());
534534
SerialBT->println(")*");
535535
SerialBT->flush();
536536
}
@@ -540,23 +540,23 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
540540
if (b == '1')
541541
{
542542
// SerialBT->println("display->rtcClearTimerFlag()");
543-
display->rtcClearTimerFlag();
543+
display->rtc.ClearTimerFlag();
544544
}
545545
break;
546546
case 'j':
547547
sscanf(s + 3, "%c", &b);
548548
if (b == '1')
549549
{
550550
// SerialBT->println("display->rtcDisableTimer()");
551-
display->rtcDisableTimer();
551+
display->rtc.DisableTimer();
552552
}
553553
break;
554554
case 'k':
555555
sscanf(s + 3, "%c", &b);
556556
if (b == '?')
557557
{
558558
SerialBT->print("#k(");
559-
SerialBT->print(display->rtcIsSet());
559+
SerialBT->print(display->rtc.IsSet());
560560
SerialBT->println(")*");
561561
SerialBT->flush();
562562
}
@@ -566,27 +566,27 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
566566
if (b == '1')
567567
{
568568
// SerialBT->println("display->rtcReset()");
569-
display->rtcReset();
569+
display->rtc.Reset();
570570
}
571571
break;
572572
case 'm':
573573
sscanf(s + 3, "%c", &b);
574574
if (b == '1')
575575
{
576-
display->frontlight(true);
576+
display->frontlight.setState(true);
577577
// SerialBT->println("display->frontlight(true);");
578578
}
579579
else
580580
{
581-
display->frontlight(false);
581+
display->frontlight.setState(false);
582582
// SerialBT->println("display->frontlight(false);");
583583
}
584584
break;
585585
case 'n':
586586
sscanf(s + 3, "%d", &br);
587587
// sprintf(temp, "display->setFrontlight(%d);\n\r", br);
588588
// SerialBT->println(temp);
589-
display->setFrontlight(br);
589+
display->frontlight.setBrightness(br);
590590
break;
591591
case 'o':
592592
sscanf(s + 3, "%d", &pwrs);
@@ -604,15 +604,15 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
604604
{
605605
// sprintf(temp, "display->tsShutdown();\n\r");
606606
// SerialBT->println(temp);
607-
display->tsShutdown();
607+
display->touchscreen.shutdown();
608608
}
609609
break;
610610
case 'r':
611611
sscanf(s + 3, "%c", &b);
612612
if (b == '?')
613613
{
614614
SerialBT->print("#r(");
615-
SerialBT->print(display->tsAvailable());
615+
SerialBT->print(display->touchscreen.available());
616616
SerialBT->println(")*");
617617
SerialBT->flush();
618618
}
@@ -621,7 +621,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
621621
sscanf(s + 3, "%c", &b);
622622
if (b == '?')
623623
{
624-
if (display->tsGetData(tx1, ty1) != 0)
624+
if (display->touchscreen.getData(tx1, ty1) != 0)
625625
{
626626
SerialBT->print("#s(");
627627
SerialBT->print(tx1[0]);
@@ -636,7 +636,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
636636
sscanf(s + 3, "%c", &b);
637637
if (b == '?')
638638
{
639-
display->tsGetRawData(rt);
639+
display->touchscreen.getRawData(rt);
640640
for (int i = 0; i < 8; ++i)
641641
{
642642
SerialBT->print("Reg ");
@@ -650,7 +650,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
650650
// sprintf(temp, "display->touchInArea(%hu, %hu, %hu, %hu);\n\r", tx2, ty2, tw, th);
651651
// SerialBT->println(temp);
652652
SerialBT->print("#u(");
653-
SerialBT->print(display->touchInArea(tx2, ty2, tw, th));
653+
SerialBT->print(display->touchscreen.touchInArea(tx2, ty2, tw, th));
654654
SerialBT->println(")*");
655655
SerialBT->flush();
656656
break;

examples/Inkplate4TEMPERA/Advanced/Communication/Inkplate4TEMPERA_EasyC/Inkplate4TEMPERA_EasyC.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error "Wrong board selection for this example, please select Soldered Inkplate4TEMPERA in the boards menu."
2121
#endif
2222

23-
#include "Hall-Effect-Digital-easyC-SOLDERED.h" // Include the Hall Effect sensor library
23+
#include "Hall-Effect-SOLDERED.h" // Include the Hall Effect sensor library
2424
#include "Inkplate.h" // Include Inkplate library to the sketch
2525

2626
// Create an object on Inkplate library and also set library into 1-bit mode (BW)

examples/Inkplate4TEMPERA/Advanced/Other/Inkplate4TEMPERA_Faster_Display_Refreshes/Inkplate4TEMPERA_Faster_Display_Refreshes.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void loop()
5555
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
5656
// and is assumed to be on already.
5757

58-
display.einkOn(); // Turn on the ePaper (be careful when using this function manually)
58+
//display.einkOn(); // Turn on the ePaper (be careful when using this function manually)
5959
display.fillCircle(200, 100, 50, BLACK); // Draw another circle
6060

6161
// Again, measure time and print result to Serial
@@ -88,15 +88,15 @@ void loop()
8888
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
8989
// and is assumed to be on already, as with display.display's leaveOn flag.
9090

91-
display.einkOn();
91+
//display.einkOn();
9292
display.fillCircle(400, 100, 50, BLACK);
9393
t = millis();
9494
display.partialUpdate(0, 1);
9595
t = millis() - t;
9696
Serial.print("display.partialUpdate(0, 1) took ");
9797
Serial.print(t);
9898
Serial.println(" ms");
99-
display.einkOff();
99+
//display.einkOff();
100100

101101
display.clearDisplay();
102102

examples/Inkplate4TEMPERA/Advanced/Sensors/Inkplate4TEMPERA_Buzzer/Inkplate4TEMPERA_Buzzer.ino

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,30 @@ void setup()
3838
display.display(); // Put clear image on display
3939

4040
// Init the buzzer, this must be called if using it
41-
display.initBuzzer();
41+
display.buzzer.init();
4242

4343
// The most basic example
4444
// This will produce three short beeps
4545
// The beeps are each 80ms long
46-
display.beep(80);
46+
display.buzzer.beep(80);
4747
delay(80);
48-
display.beep(80);
48+
display.buzzer.beep(80);
4949
delay(80);
50-
display.beep(80);
50+
display.buzzer.beep(80);
5151
delay(80);
5252

5353
delay(5000); // Wait 5 seconds before the next example
5454

5555
// The buzzer may also be controlled by manually turning it on or off
5656
// beepOn will turn on the buzzer indefinitely until beepOff is called
5757
// This will produce two 200 ms beeps
58-
display.beepOn();
58+
display.buzzer.beepOn();
5959
delay(200);
60-
display.beepOff();
60+
display.buzzer.beepOff();
6161
delay(200);
62-
display.beepOn();
62+
display.buzzer.beepOn();
6363
delay(200);
64-
display.beepOff();
64+
display.buzzer.beepOff();
6565
delay(200);
6666

6767
delay(5000); // Wait 5 seconds before the next example
@@ -70,13 +70,13 @@ void setup()
7070
// Note that pitch is approximated as the digital potentiometer does not affect the pitch in a linear way
7171
// Frequencies from 572 to 2933 Hz are supported
7272
// Here are two low pitched (~750Hz) followed by two high pitched (~2400Hz) beeps
73-
display.beep(300, 750);
73+
display.buzzer.beep(300, 750);
7474
delay(50);
75-
display.beep(300, 750);
75+
display.buzzer.beep(300, 750);
7676
delay(50);
77-
display.beep(300, 2400);
77+
display.buzzer.beep(300, 2400);
7878
delay(50);
79-
display.beep(300, 2400);
79+
display.buzzer.beep(300, 2400);
8080
delay(50);
8181

8282
delay(5000); // Wait 5 seconds before the next example
@@ -89,16 +89,16 @@ void loop()
8989
if (repeatCounter < 2)
9090
{
9191
// Play the note set to be played for 100 ms
92-
display.beep(100, chord[currentNoteIndex]);
92+
display.buzzer.beep(100, chord[currentNoteIndex]);
9393
delay(600); // Wait 600 ms so there's room between the notes
9494
}
9595
// The second four times play the notes twice
9696
else
9797
{
9898
// Play the note set to be played for 100 ms
99-
display.beep(100, chord[currentNoteIndex]);
99+
display.buzzer.beep(100, chord[currentNoteIndex]);
100100
delay(250); // Wait 300 ms and play it again for 50 ms
101-
display.beep(50, chord[currentNoteIndex]);
101+
display.buzzer.beep(50, chord[currentNoteIndex]);
102102
delay(300); // Wait for 300 ms, this totals to 700 so it's in rhythm
103103
}
104104

examples/Inkplate4TEMPERA/Advanced/WEB_WiFi/Inkplate4TEMPERA_Show_JPG_With_HTTPClient/Inkplate4TEMPERA_Show_JPG_With_HTTPClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void setup()
6767

6868
// Switch to 3-bit mode so the image will be of better quality
6969
// NOTE: You can't use partial update when the Inkplate is in the 3-bit mode!
70-
display.setDisplayMode(INKPLATE_3BIT);
70+
display.selectDisplayMode(INKPLATE_3BIT);
7171

7272
// Make an object for the HTTP client
7373
HTTPClient http;

0 commit comments

Comments
 (0)