embassy-rs / nrf-softdevice

Apache License 2.0
264 stars 79 forks source link

Added BLE notification example with sensor reading #142

Closed Ardelean-Calin closed 2 years ago

Ardelean-Calin commented 2 years ago

In order to showcase how to use embassy to gather sensor data and upload said data somewhere via BLE, I have created an example that logs ADC values every second and updates the Battery Level Characteristic of the Battery Service with the read value.

To do that, I am running two futures in parallel, one for the GATT Server and another for the "aquisition task".

I tried to include comments where it helped me understand the code better while working on this example.

alexmoon commented 2 years ago

LGTM, thanks for the contribution!