Read data from the accelerometer sensor on BBC micro:bit board
[data] = readAcceleration(obj)
Create a connection to the BBC micro:bit hardware connected to the COM4 port, and read the acceleration along the three axes of the BBC micro:bit hardware port.
>>m = microbit('COM4'); >>[data] = readAcceleration(m) data = 0.0781 -8.0124 0.0273
data— Data read from accelerometer sensor
Three-dimensional accelerometer data from the BBC micro:bit board measured along the x-, y-, and z- axes, relative to the position of the board, and specified in ㎨.