The measurement speed is restricted by python speed in the loopThere is a limit at 20Hz on a Pi3The setup is a RPi3, input is a square wave generated by a RPi pico (could be done on RPi3 too, but pico is just sitting on the desk here for some experiments).
You could have a look to https://abyz.me.uk/rpi/pigpio/code/TCS3200_py.zip .
Code:
def measure(meas_time): """ local modification of a measurement loop """ start = time.time() count = 0 while (meas_time - (time.time() - start)) > 0: rpi.wait_for_edge(out_10_pin, pigpio.RISING_EDGE) count += 1 return countYou could have a look to https://abyz.me.uk/rpi/pigpio/code/TCS3200_py.zip .
Statistics: Posted by ghp — Mon Nov 10, 2025 9:45 pm