![]() ![]() Serial.println("Made it to the config fn.") Serial.println("Magnetometer config done.") Serial.begin(9600) // start serial for output Wire.begin() // join i2c bus (address optional for master) #define MAG_ADDR 0x0E //7-bit address for the MAG3110, doesn't change This sketch does not use the INT1 pin, nor does it poll for The code reads the raw 16-bit x, y, and z values and prints them License: beerware, if you use this code and happen to meet me, you )īy: Aaron Weiss, aaron at sparkfun dot com ![]() Is it possible that my magnetometer is just fried? (Unfortunately, I don't have another arduino to test it on. Īny thoughts on how to debug further? I'm at a bit of a loss, I'll admit. I've quadruple-checked my wiring and everything looks correct. Output always makes it to the line right before the first call to Wire.endTransmission() in the config() function - In particular the output looks like: Serial started.īased on internet research, it sounds like there's either an obscure problem with the Wire library or I'm just not communicating with my I2C device (which sounds more likely). Similar but his at least runs for a while:.Looking around online, I found others are having this problem as well: Trying to set up the I2C sensor to take magnetic field data, but debugging is showing that Wire.endTransmission() hangs the sketch (debug code below). I2C hardware: MAG3110 magnetometer ( Triple Axis Magnetometer Breakout - MAG3110 - SEN-10619 - SparkFun Electronics)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |