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

MicroPython • Re: Frequency counter stops after while

$
0
0
Thanks, I made only change in:

Code:

def counter_handler(sm):        #print("IRQ")        global update_flag        if not update_flag:            gateVal = int(MFREQ/1000)            #sm0.put(gateVal)            sm0.put(50000000)            sm0.exec("pull()")            data[0] = sm1.get() # clock count            data[1] = sm2.get() # pulse count            update_flag = True
and it works beautifull. Very stable readings. Tested only little over 1kHz.
Is this ok, or should I change it somewhere else to?

Statistics: Posted by California — Thu Feb 22, 2024 11:58 am



Viewing all articles
Browse latest Browse all 4817

Trending Articles