// Testando a biblioteca FreqCount.h

#include "FreqCount.h"                    // Counter input on D5

#define clock 13

void setup() {
  Serial.begin(57600);
  FreqCount.begin(1000);
  pinMode(clock, OUTPUT) ;
}

void loop() {
  tick();
  if (FreqCount.available()) {
    unsigned long count = FreqCount.read();  // Counter input on D5
    Serial.println(count);
  }
}

void tick() {       //tick = marcação
  digitalWrite(clock, 1);
  //delay(30);            // saída = 33
  //delay(20);            //saída = 50
  //delay(10);          //saida = 100
  delay(50);            // saída = 20
  digitalWrite(clock, 0);
}