Confused by oscilloscope - square wave signal to RPM

OK. After that, post your latest code.