I've noticed something.
Other implementations of read take a registry variable, and then write to that registry first and then read the first byte from the device, but after a lot of testing it seems that the first byte here is always either 0 or 255
The device sets that byte from 0 to 255 when this is called:
// Activate at max rate, low noise mode
this.writeRegister8(this.MMA8451_REG_CTRL_REG1, 0x01 | 0x04);
After work I'll go back and look at the datasheet, but I am wondering if perhaps it just always sends the data in the array back in the same order, no matter what is sent to it.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I've noticed something.
Other implementations of read take a registry variable, and then write to that registry first and then read the first byte from the device, but after a lot of testing it seems that the first byte here is always either 0 or 255
The device sets that byte from 0 to 255 when this is called:
After work I'll go back and look at the datasheet, but I am wondering if perhaps it just always sends the data in the array back in the same order, no matter what is sent to it.