Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- touchAttachInterrupt(T3, [](){ }, 40); // กำหนดใช้เซ็นเซอร์สำผัสช่อง T3 และให้มีค่าเกิน 40 จึงเกิดอินเตอร์รัพท์
- esp_deep_sleep_enable_touchpad_wakeup(); // กำหนดการตื่นด้วยเซ็นเซอร์สัมผัส
- // โค้ดโปรแกรมอื่น ๆ ที่จะใช้แสดงผลไปที่จอ
- //
- //
- }
- void loop() {
- if (millis() > 30 * 1000) { // ถ้าครบ 30 วินาที
- esp_deep_sleep_start(); // เข้าสู่โหมด Deep Sleep
- }
- // คำสั่งอื่น ๆ ในลูป
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement