Open CodapopKSP opened 3 years ago
What should this do ? This will not reset the whole arduino as the reset button does. If you need an actual Arduino reset, you can use a dedicated button on your controller.
If you want you can unsubscribe all the channel and stop sending messages to KSP. It will remove all the traffic on the serial connection. What should the call to mysimpit.disconnect()
do differently ?
On the other end, a call to mysimpit.init()
is the function that open the connection. What would be the difference with mysimpit.connect()
?
Does unsubscribing from every channel also end the serial connection? In the case of my board, the arduino sometimes has to do other things that aren't part of simpit, and sometimes it needs the serial connection to do that. It would be nice to be able to script the start/stop in the arduino code so it can handle the switch between modes automatically.
You can call Serial.end if you need to close the connection.
That doesn't appear to allow the arduino to reconnect again, and a reset is neccesary either way.
Do you still need this?
In fact... give me an hour....
This could function as a 'soft' reset to handle times when the connection has problems. Most boards have the arduino located inside and potentially inaccessible, so pressing the reset button may not be an option.
A simple callable set of functions would be ideal, maybe "mysimpit.connect, mysimpit.disconnect".