harry11733
Member
Simple question. I have a Python program on a Mac that talks via USB to a teensy 3.1 board for data collection and also sets parameters for the DAC. During the setup procedure the teensy board and Python go through a simple handshake routine to check that they can communicate. If I quit the Python program and then restart the Python program it now tries to talk to the teensy board, which is now stuck in the main loop, and the handshake routine obviously doesn't work so the Python program just hangs, waiting to complete the handshake.
Ideally I would make the teensy board reset each time the Python program starts so that the handshake routine runs correctly. Is there a way to do this? I could reset the teensy every time I quit the Python program but this assumes it quits in a defined way, which is not always the case, at least when programming. Another alternative are to do the handshake in the main loop. Not sure how best to do this. Or, I could also just eliminate the handshake, it doesn't do anything particularly useful I guess, and just assume that things are OK and wait for data to be uploaded.
Any suggestions appreciated.
Ideally I would make the teensy board reset each time the Python program starts so that the handshake routine runs correctly. Is there a way to do this? I could reset the teensy every time I quit the Python program but this assumes it quits in a defined way, which is not always the case, at least when programming. Another alternative are to do the handshake in the main loop. Not sure how best to do this. Or, I could also just eliminate the handshake, it doesn't do anything particularly useful I guess, and just assume that things are OK and wait for data to be uploaded.
Any suggestions appreciated.