SRF02 and CMPS03 Libraries

Hi everyone,

just in case someone is interested: I've written two Arduino libraries for interfacing with SRF02 (ultrasonic range) and CMPS03 (magnetic compass) sensors. The libraries are released under the MPL (Mozilla Public License) and are available from my homepage

SRF02 Library:

CMPS03 Library:

Please feel free to use them in your own projects, if you like. If you have comments or ideas for further enhancements, you can write to I'm planning to release some more libraries as I am advancing in my own robot projects.

Regards, Dirk


I just used your library for controlling 2 SR02's. Works great. I wasn't sure how to change the adress on one of them, but the page on your site explains it very clearly.