GY-45 MMA8451 Module Digital Triaxial Accelerometer

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
ldaponte
Posts: 4
Joined: Sun Dec 16, 2018 10:06 pm

GY-45 MMA8451 Module Digital Triaxial Accelerometer

Post by ldaponte » Mon Jan 07, 2019 7:57 am

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

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: GY-45 MMA8451 Module Digital Triaxial Accelerometer

Post by Roberthh » Mon Jan 07, 2019 8:46 am

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.

ldaponte
Posts: 4
Joined: Sun Dec 16, 2018 10:06 pm

Re: GY-45 MMA8451 Module Digital Triaxial Accelerometer

Post by ldaponte » Fri Jan 11, 2019 4:02 pm

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

Post Reply