my original compass was a HMC5883 - I purchases 2 new compasses and started testing.
They didn't work.
After careful checking the supplier has now substituted MAG3110 based compasses - different I2c address and different codes.
Have them working under python now have to decode what the python module is doing and transcribe to C.
(Also just got out of hospital having gallstone removed - so that has slowed me down a tad!)