Hi
I need to built a pythonfile.py that starts to do a task (monitor at all time a serial port)
And when a certain condition is true(receive a certain byte in serial) start/stop certain functions that I already have.
But is important that the task of reading the serial port is always running and never stops.
So imagine that I have
Threading?
callback?
Watchdog?
If someone give a possible structure I would appreciate since I'm an not an expert at programming
thanks
I need to built a pythonfile.py that starts to do a task (monitor at all time a serial port)
And when a certain condition is true(receive a certain byte in serial) start/stop certain functions that I already have.
But is important that the task of reading the serial port is always running and never stops.
So imagine that I have
Readserial() While true: Read the serial port (I know how to do this) If readbyte = 0x65: #(for example) Kill or start function1() #(but at the same time Readserial() should continue monitoring serial port) If read byte = 0xFF: #example Kill or start function2() #(again readSerial() should continue to run) Function1() Do something Function2() Do somethingWhat is my best solution for this
Threading?
callback?
Watchdog?
If someone give a possible structure I would appreciate since I'm an not an expert at programming
thanks