pololu/LSM303 — pull request #2 by spirilis (2012-05-03 01:36:26+00:00)
Title: Added a timeout feature

Hi there- I'm using your LSM303DLM breakout board and I really like it, it's a cornerstone to a gadget I'm building. However I noticed the library busy-waits in a while(Wire.available() < 6) loop which can be a show-stopper if the device gets disconnected or whatnot, so I made these changes.

is_timeout() is a status checker for after running read(), setTimeout() sets the timeout in milliseconds and getTimeout() retrieves the current timeout setting.