This is the library I have used for the direction sensors