Skip to content

Instantly share code, notes, and snippets.

@jacksonkeating
Created April 9, 2024 17:57
Show Gist options
  • Save jacksonkeating/d4d1b5354397d1856297ff581c2e2d0f to your computer and use it in GitHub Desktop.
Save jacksonkeating/d4d1b5354397d1856297ff581c2e2d0f to your computer and use it in GitHub Desktop.
var result = {}
await wavecake.ble.connect('', '0000180f-0000-1000-8000-00805f9b34fb')
while(true) {
result = await wavecake.ble.readCharacteristic('', '0000180f-0000-1000-8000-00805f9b34fb', '00002a19-0000-1000-8000-00805f9b34fb')
wavecake.ui.message("Battery Level: " + result.data[0] + "%")
wavecake.ui.data(result.data[0])
await timeout(1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment