int readMag(unsigned int coor) { int aux; digitalWrite(CSB3, LOW); SPI.transfer(0xC0 + coor); aux = (SPI.transfer(0x00) >> 3); digitalWrite(CSB3, HIGH); digitalWrite(CSB3, LOW); SPI.transfer(0xC0 + coor + 1); aux += (SPI.transfer(0x00) << 5); digitalWrite(CSB3, HIGH); return aux; } void loop(){ ////////////////////////////////////////////////////////////////////////////MAG READ / PRINT x = readMag(x_lsb); y = readMag(y_lsb); z = readMag(z_lsb); Serial.print(x); Serial.print(","); Serial.print(y); Serial.print(","); Serial.println(z); } I have tried reading the mag like this and still no result. I did use I2C before but dont understand what you mean by releasing the pin for host control. I also used (0x80),instead of (0xC0) (and many other specified in datasheets), for the readings, as used in the acc and gyro and no result. Thank you again!
... View more