PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

20 linhas
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. }