LIS2MDL code ***help request***

Ok, strip it down.
Put that code aside, and concentrate on reading a single input using the built-in pullup