The microbit library on online mbed is never updated. Information betweem github and online mbed is not consistent.
Github has new library for microbit issued by Lancaster University.
This affect the operations on several example like the example using accelerometer!
Someone should update the microbit library in online mbed!