Hi, getting started with micro:bit here.
At this point, I’m only interested in accelerometer data.
Would it be preferable to access the accelerometer service directly, or through UART?
“Directly” as in https://github.com/alcir/microbit-ble/blob/master/python/accelerometerBall.py –
svc = p.getServiceByUUID("e95d0753-251d-470a-a062-fa1922dfa9a8")
ch = svc.getCharacteristics("e95dca4b-251d-470a-a062-fa1922dfa9a8")[0]
chper = svc.getCharacteristics("e95dfb24-251d-470a-a062-fa1922dfa9a8")[0]
... then, in the loop
coord = np.fromstring(ch.read(), dtype=np.int16, count=3)
The same repository has a UART collector example (https://github.com/alcir/microbit-ble/blob/master/python/uart_collector.py) – I can see where it’s waiting for a notification, but I don’t see where the data live, in this example.
So another way to ask the question is: The direct access approach looks superficially easier, but is that only shooting myself in the foot?
TIA,
hjh