Teensy 3.6 + HMC5883L

Photo

Using 1.8k ohms resistors

I2C protocol3.3 volts

Fritzing

copy/paste Sketch