I am currently trying to develop an application as "addon" for a hobby RC receiver. The receiver runs a proprietary protocol in a half-duplex mode. I am using the Pyboard as development platform (I was a kickstarter backer in 2014
![Smile :)](./images/smilies/icon_e_smile.gif)
I started over to implement the basic overall logic and I am able to interact with all involved components (there are still lots of errors but a foundation is done). Now I need to implement asynchronous communication to make it work properly.
The receiver (as the half-duplex master) sends packets via UART every 10ms. In some packets there is a dedicated request for answering. The time for answering by the Pyboard (slave) is limited with 4ms. I guess I need to buffer the sensor data (from I2C) and prepare the answer to the request in an asynchronous manner. Everything needs to be ready when the request comes in, so that the 4ms answer time frame can be kept. The current implementation is done in a "linear" manner and does not meet that timing requirement.
I was now studying the uasyncio V3 tutorial and demos, which I roughly can follow, far from feeling comfortable with it.
My question is now which of the demos fits best to my application or do I need to couple several of them?
How should the data be buffered (sensor data, protocol packet)? If anyone can point me to respective examples I would dare to try to adapt it to my code.
Best regards,
Andreas