Is there any way to program an interrupt when a digital input pin goes high in WaveForms SDK with Analog Discovery 2 or Digital Discovery?
I want to write a code (using WaveForms SDK), with which I wait for a digital input pin to go high. After the pin goes high, I want to continue with the program. Something like the following code:
# Some codewhile(not digitalInputPinIsHigh()):continue# Continue with the program
The problem is that the pin's output is a pulse that is only high for 30 μs, so if I continuously check the digital input pin until it goes high, I think I can miss the pulse. Is there a way to program an interrupt (some code/function that is executed when the pin goes high)? Something like the following code:
def ISR():
digitalInputPulseArrived =True# Some code
digitalInputPulseArrived =Falsewhile(not digitalInputPulseArrived):continue# Continue with the program
Question
Nico G
Is there any way to program an interrupt when a digital input pin goes high in WaveForms SDK with Analog Discovery 2 or Digital Discovery?
I want to write a code (using WaveForms SDK), with which I wait for a digital input pin to go high. After the pin goes high, I want to continue with the program. Something like the following code:
The problem is that the pin's output is a pulse that is only high for 30 μs, so if I continuously check the digital input pin until it goes high, I think I can miss the pulse. Is there a way to program an interrupt (some code/function that is executed when the pin goes high)? Something like the following code:
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.