Page 1 of 1

GY-45 MMA8451 Module Digital Triaxial Accelerometer

Posted: Mon Jan 07, 2019 7:57 am
by ldaponte
I have found a CircuitPython driver but no MicroPython driver for the GY-45 MMA8451 Digital Accelerometer. Can someone point me to a MicroPython driver? If not, I’ll try to port the CircuitPython version, is there a guide for the differences in the two versions of Python that would help me in such a conversion? I suppose getting a CircuitPython board would help me in such a conversion.

Thanks

Larry

Re: GY-45 MMA8451 Module Digital Triaxial Accelerometer

Posted: Mon Jan 07, 2019 8:46 am
by Roberthh
That looks pretty easy. Only the I2C access methods have to be adapted, in this case simplified. That affctes the methods _read_into(), _write_u8() and _read_u8(). The can be replaced by the i2c module methods writeto_mem, readfrom_mem and readfrom_mem_into.

Re: GY-45 MMA8451 Module Digital Triaxial Accelerometer

Posted: Fri Jan 11, 2019 4:02 pm
by ldaponte
Thanks for the response, I have a CircuitPython device coming to me and I'll use it to aid my port of the driver to MicroPython. Will reports my results here.

Thanks

Larry