Perhaps you are not aware of this, but in C/C++, arrays do not know their own size(an 'array' variable is actually just the memory address of the first entry) so the size must always be supplied separately.
I had no idea no. I've done C# and js/ts, but not much C or C++.
What you write makes me think that I should do something like this
this.i2c.writeTo(this.MMA8451_ADDR, this.MMA8451_REG_OUT_X_MSB);
let buffer = this.i2c.readFrom(this.MMA8451_ADDR, 6);
Where I then only send the value the "write_then_read" function sends, and then read 6 bytes from the same address, however the data I get out still seems wrong, here are 4 readings and again it's just lying on the table not moving.
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 had no idea no. I've done C# and js/ts, but not much C or C++.
What you write makes me think that I should do something like this
Where I then only send the value the "write_then_read" function sends, and then read 6 bytes from the same address, however the data I get out still seems wrong, here are 4 readings and again it's just lying on the table not moving.