Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1579

Python • Re: Frequency of output really low when using RPi 3 with TCS3200 and pigpio

$
0
0
The measurement speed is restricted by python speed in the loop

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 count
There is a limit at 20Hz on a Pi3
freq_measure.png
The 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 .

Statistics: Posted by ghp — Mon Nov 10, 2025 9:45 pm



Viewing all articles
Browse latest Browse all 1579

Trending Articles