PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 line
1001B

  1. // Example for blinking multiple LEDs
  2. #include "LED.h"
  3. // Pins for LED objects
  4. const int pinLED = 13;
  5. // const int pinLED1 = 3;
  6. // const int pinLED2 = 4;
  7. // ...
  8. // LED Objects
  9. LED* led;
  10. // LED* led1;
  11. // LED* led2;
  12. // ...
  13. // Timing variables
  14. const int blinkForMSeconds = 10000;
  15. const int blinkPeriodMSeconds = 1000;
  16. const int blinkDuty = 90;
  17. // const int blinkForMSeconds1 = 20000;
  18. // const int blinkPeriodMSeconds1 = 500;
  19. // const int blinkDuty1 = 25;
  20. // const int blinkForMSeconds2 = 5000;
  21. // const int blinkPeriodMSeconds2 = 1500;
  22. // const int blinkDuty2 = 75;
  23. // ...
  24. void setup(){
  25. delay(1000);
  26. led = new LED(pinLED);
  27. // led1 = new LED(pinLED1);
  28. // led2 = new LED(pinLED2);
  29. // ...
  30. // Start threads
  31. led->startBlinking(blinkForMSeconds, blinkPeriodMSeconds, blinkDuty);
  32. //led1->startBlinking(blinkForMSeconds1, blinkPeriodMSeconds1, blinkDuty1);
  33. //led2->startBlinking(blinkForMSeconds2, blinkPeriodMSeconds2, blinkDuty2));
  34. // ...
  35. }
  36. void loop(){
  37. // Implement main as needed
  38. }