PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SkeletonDriverClass.ino 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /********************************************************************
  2. - Snooze Skelton Driver Example -
  3. A driver class needs to inherient from the SnoozeBlock class. You must
  4. override the 'enableDriver', 'disbaleDriver' and optional 'clearIsrFlags'
  5. virtual functions.
  6. This example driver class saves the state of the pin, configures
  7. it as an OUTPUT and blinks the LED before and after going to sleep.
  8. Supported Micros: T-LC/3.x/4.0
  9. ********************************************************************/
  10. #include <Snooze.h>
  11. #include <wiring.h>
  12. #include "SnoozeSkeletonDriverClass.h"
  13. // Load drivers
  14. SnoozeSkeletonDriverClass skeleton;
  15. SnoozeTimer timer;
  16. // install drivers to a configuration block
  17. SnoozeBlock config(skeleton, timer);
  18. void setup() {
  19. pinMode(LED_BUILTIN, INPUT_PULLUP);
  20. //pinMode(LED_BUILTIN, INPUT);
  21. // configure the skeleton driver to toggle before and after sleeping
  22. skeleton.configure(LED_BUILTIN);
  23. // configure the timer driver to wake in 1000 milliseconds
  24. timer.setTimer(1000);
  25. delay(1000);
  26. }
  27. void loop() {
  28. // sleep now
  29. Snooze.deepSleep( config );// return module that woke processor
  30. delay(1000);
  31. }