6
6
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
7
7
8
8
Here is shown how to use I/O Expander and ESP interrupts to wake up the MCU from deepsleep when touchpad is pressed.
9
-
10
- NOTE: This is an example for the old Inkplates that have touchpads.
11
- If you select new Inkplate boards, you won't be able to compile the example.
9
+
10
+ NOTE: This is an example for the old Inkplates that have touchpads.
12
11
13
12
Want to learn more about Inkplate? Visit www.inkplate.io
14
13
Looking to get support? Write on our forums: https://forum.soldered.com/
@@ -45,10 +44,16 @@ void setup()
45
44
display.begin ();
46
45
47
46
// Set interrupt pins
47
+ #if defined(ARDUINO_INKPLATE10)
48
48
display.setIntOutput (1 , false , false , HIGH, IO_INT_ADDR);
49
49
display.setIntPin (PAD1, RISING, IO_INT_ADDR);
50
50
display.setIntPin (PAD2, RISING, IO_INT_ADDR);
51
51
display.setIntPin (PAD3, RISING, IO_INT_ADDR);
52
+ #elif defined(ARDUINO_INKPLATE10V2)
53
+ display.setIntPin (PAD1, IO_INT_ADDR);
54
+ display.setIntPin (PAD2, IO_INT_ADDR);
55
+ display.setIntPin (PAD3, IO_INT_ADDR);
56
+ #endif
52
57
53
58
++bootCount;
54
59
@@ -59,8 +64,14 @@ void setup()
59
64
esp_sleep_enable_timer_wakeup (TIME_TO_SLEEP * uS_TO_S_FACTOR);
60
65
61
66
// Enable wakup from deep sleep on gpio 34
67
+ #if defined(ARDUINO_INKPLATE10)
68
+ // MCP I/O expander sends logic HIGH pulse signal as interrupt.
62
69
esp_sleep_enable_ext1_wakeup (TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);
63
-
70
+ #elif defined(ARDUINO_INKPLATE10V2)
71
+ // PCAL I/O expander sends logic LOW pulse signal as interrupt.
72
+ esp_sleep_enable_ext1_wakeup (TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ALL_LOW);
73
+ #endif
74
+
64
75
// Go to sleep
65
76
esp_deep_sleep_start ();
66
77
}
0 commit comments