pycom / pycom-libraries

MicroPython libraries and examples that work out of the box on Pycom's IoT modules
330 stars 378 forks source link

Spot when pressure sensor has stalled and reset it. #95

Closed amcewen closed 3 years ago

amcewen commented 5 years ago

What does this implement/fix? Explain your changes.

This fixes the problem with the MPL3115A2 on the pysense board occasionally hanging. The code gets into an infinite loop if the sensor fails to respond over I2C.

The code now spots if there hasn't been a response, and resets the MPL3115A2 sensor. The failure is communicated to the main code as an exception, and no result is returned, but the next time the call is made the sensor will be reset and will return values again.

Does this close any currently open issues?

This will close issue #46.

Where has this been tested?

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Adrian McEwen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

gijsio commented 3 years ago

Hi, Sorry for the extremely long delay. Thanks a lot for the contribution, in the meantime we moved some files around and, instead, merged your solution in #146.

Best, Gijs