adafruit / Adafruit_HMC5883_Unified

48 stars 35 forks source link

At least use a timeout with the while so that my code does not hang, #4

Open grossadamm opened 8 years ago

grossadamm commented 8 years ago

it should also handle the case where the millis resets after 50 days or so.

Adds ability to have a timeout in seconds in the constructor for use in the read function during the never ending while loop. This new param is not required.

A best effort of backwards compatibility is used by setting the default timeout to be 120 seconds. Which is far longer than most hobbyists will wait :smile:.

grossadamm commented 8 years ago

Also pulled in @clik86's work

Koepel commented 6 years ago

@grossadamm Have you investigated how the Wire library works ? Are you willing to remove this Pull Request with the timeout ? I have made a Wiki with common mistakes: https://github.com/Koepel/How-to-use-the-Arduino-Wire-library/wiki/Common-mistakes