Skip to content

Commit 98c7028

Browse files
committed
Fixed example "Wake Up On Touchpads" for IP10.
1 parent f2bf17b commit 98c7028

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

examples/Inkplate10/Advanced/DeepSleep/Inkplate10_Wake_Up_On_Touchpads/Inkplate10_Wake_Up_On_Touchpads.ino

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
https://soldered.com/learn/add-inkplate-6-board-definition-to-arduino-ide/
77
88
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.
1211
1312
Want to learn more about Inkplate? Visit www.inkplate.io
1413
Looking to get support? Write on our forums: https://forum.soldered.com/
@@ -45,10 +44,16 @@ void setup()
4544
display.begin();
4645

4746
// Set interrupt pins
47+
#if defined(ARDUINO_INKPLATE10)
4848
display.setIntOutput(1, false, false, HIGH, IO_INT_ADDR);
4949
display.setIntPin(PAD1, RISING, IO_INT_ADDR);
5050
display.setIntPin(PAD2, RISING, IO_INT_ADDR);
5151
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
5257

5358
++bootCount;
5459

@@ -59,8 +64,14 @@ void setup()
5964
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
6065

6166
// 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.
6269
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+
6475
// Go to sleep
6576
esp_deep_sleep_start();
6677
}

0 commit comments

Comments
 (0)