thwill
 Guru
 Joined: 16/09/2019 Location: United KingdomPosts: 4378 |
| Posted: 10:36am 21 Jan 2022 |
|
|
|
IIRC
I2C2 CLOSE
releases the pins, so the second time you enter compass() they are not set. To resolve move the SETPIN into compass() or the OPEN/CLOSE out of compass().
Best wishes,
Tom |