Arduino Nano Frequency Counter. Not a good coder here, but I think you should use interrupts for co