New answers tagged

2 votes

Capturing frequency using a photodiode

Counting in a loop like that is fine if you have a very low frequency signal, and are getting the hang of how loops, and reading from input pins, work. But there will be a lot of overheads. As Edgar ...
Nick Gammon's user avatar
  • 38.2k
2 votes

Capturing frequency using a photodiode

Consider this loop: for(int i=0; i< size;i++){ // Read sensor value sensorValue[i] = analogRead(sensorPin); // wait between readings for N microseconds delayMicroseconds(dly); } The time ...
Edgar Bonet's user avatar
  • 43.1k

Top 50 recent answers are included