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.

20 lines
361B

  1. /* FreqCount - Example with serial output
  2. * http://www.pjrc.com/teensy/td_libs_FreqCount.html
  3. *
  4. * This example code is in the public domain.
  5. */
  6. #include <FreqCount.h>
  7. void setup() {
  8. Serial.begin(57600);
  9. FreqCount.begin(1000);
  10. }
  11. void loop() {
  12. if (FreqCount.available()) {
  13. unsigned long count = FreqCount.read();
  14. Serial.println(count);
  15. }
  16. }