I have this so far, for writing as fast as possible to a gatt characteristic. The timing seems to vary though, and certainly the writing isn't 'continuous'. Is there a way to do better? I want to write 10 times per second, as stable as possible.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have this so far, for writing as fast as possible to a gatt characteristic. The timing seems to vary though, and certainly the writing isn't 'continuous'. Is there a way to do better? I want to write 10 times per second, as stable as possible.
I'm most familiar with writing in C or Python, so unfamiliar with Promises. I think I need to use them here, since if I simply call
char.writeValue(calculateValue())
in a loop then often there's an error that BLE is busy (from https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/libs/bluetooth/jswrap_bluetooth.c#L78 )