Hi! Not sure how trivial my problem/question is (maybe this should be moved to “beginners”?). I would appreciate any help.
What I have is RPi4 (running Lite system and oF 0.11.2), one of the GPIO ports is connected to a currency validator (coin/token/bill acceptor). Once a valid coin is inserted, the device will send a 100ms
signal.
For security reasons I need to make sure that the signal duration is with 10% tolerance (so it needs to be between 90ms
and 110ms
). Signal length 89ms
and shorter or 111ms
and longer should be detected as invalid. So I need a precise way to measure signal duration.
I assume I need to monitor GPIO ports outside the main ofApp::update()
loop (which is 60fps/Hz
). In a separate thread? Any help with measuring signal length at for example 250Hz
?
2 posts - 2 participants