Hi, I want to use the Adafruit HMC5883L Magnetometer on the Arduino 101 board. But at the moment, it doesn't pump out any values (header/ headerDegrees), it does actually display the pre-startup jargon though...
i.e
void displaySensorDetails()
{
sensor_t sensor;
mag.getSensor(&sensor);
Serial.println("------------------------------------");
Serial.print ("Sensor: "); Serial.println(sensor.name);
Serial.print ("Driver Ver: "); Serial.println(sensor.version);
Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id);
Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" uT");
Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" uT");
Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" uT");
Serial.println("------------------------------------");
Serial.println("");
delay(500);
}
I have an Uno too, and the HMC5883L works fine with this, but doesn't for the 101. I have the I2C pins conencted to SCL and SDA on the 101 (not to pins A4 and A5, but have tried this too). Is the Magnetometer too outdated for the 101, does the 101 lack support?
Though I am using a PID controller and the HMC5883L as the input for this, (and using Servo's as the output) and I am having problems with this responding with the output, which is just displaying the lowest possible value (i.e if definte output limits (0, 100), it will just stay at 0) for the output (this is with the Uno). I have written a PID for the 101's onboard IMU, which works fine for the PID controller, except the IMU drifts in the YAW axis, which is why I wanted to connect the Magnetometer as a second point of reference.
If anyone could provide me with a bit of advice, I would be most grateful!
Though a little bit hesitant to upload my full code, not because I don't want to, it's because my project is actually a masters project, so I'm not sure the "rules" about uploading my work which will be formally assessed (but asking for help/ suggestions is fine). Though my code is based upon the prewritten magsensor example, with the PID controller integrated. I have taken the local variables out of the code and made them global.
EDIT:
Never Mind,
got it to work!