|
1 | 1 | /*
|
2 |
| - Inkplate_Wake_up_on_touchpads example for e-radionica.com Inkplate 6 |
| 2 | + Inkplate_Wake_up_on_touchscreen example for e-radionica.com Inkplate 6 |
3 | 3 | For this example you will need USB cable and an Inkplate 6
|
4 | 4 | Select "Inkplate 6(ESP32)" from Tools -> Board menu.
|
5 | 5 | Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
|
6 | 6 | https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
|
7 | 7 |
|
8 |
| - Here is shown how to use MCP and ESP interrupts to wake up the MCU from deepsleep when touchpad is pressed. |
| 8 | + Here is shown how to use MCP and ESP interrupts to wake up the MCU from deepsleep when touchscreen or wake up button |
| 9 | + is pressed. |
9 | 10 |
|
10 | 11 | Want to learn more about Inkplate? Visit www.inkplate.io
|
11 | 12 | Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
|
@@ -42,19 +43,29 @@ void setup()
|
42 | 43 | display.setIntOutput(1, false, false, HIGH);
|
43 | 44 | display.setIntPin(touchPadPin, RISING);
|
44 | 45 |
|
| 46 | + // Init touchscreen and power it on after init (send false as argument to put it in deep sleep right after init) |
| 47 | + if (display.tsInit(true)) |
| 48 | + { |
| 49 | + Serial.println("Touchscreen init ok"); |
| 50 | + } |
| 51 | + else |
| 52 | + { |
| 53 | + Serial.println("Touchscreen init fail"); |
| 54 | + while (true) |
| 55 | + ; |
| 56 | + } |
| 57 | + |
45 | 58 | ++bootCount;
|
46 | 59 |
|
47 | 60 | // Our function declared below
|
48 | 61 | displayInfo();
|
49 | 62 |
|
50 |
| - // Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34 |
51 |
| - // Gpio 34 is where the mcp interrupt is connected, check |
52 |
| - // https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf |
53 |
| - // for more detail |
| 63 | + // Go to sleep for TIME_TO_SLEEP seconds. |
54 | 64 | esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
|
55 |
| - esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1); |
56 | 65 |
|
57 |
| - // Enable wakup from deep sleep on gpio 36 |
| 66 | + // Enable wake up from deep sleep on gpio 36 (wake up button and Touch INT pin), check |
| 67 | + // https://github.com/e-radionicacom/Inkplate-6PLUS-Hardware/blob/main/Schematics%2C%20Gerber%2C%20BOM/v1.0/Inkplate%206PLUS%20Schematics%20v1.0.pdf |
| 68 | + // for more detail |
58 | 69 | esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, 0);
|
59 | 70 |
|
60 | 71 | // Go to sleep
|
|
0 commit comments