Mag3110 Library not working with Microbit

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Blueshark
 
Posts: 221
Joined: Thu Dec 21, 2017 7:19 pm

Mag3110 Library not working with Microbit

Post by Blueshark »

Following this tutorial...
https://learn.adafruit.com/use-micro-bi ... gnetometer

tutorial states using SparkFun MAG3110 library but its not compatible with the Microbit see code and error message's.

code...

Code: Select all

/*  ********************************************* 
 *  SparkFun_MAG3110_Basic
 *  Triple Axis Magnetometer Breakout - MAG3110 
 *  Hook Up Guide Example 
 *  
 *  Utilizing Sparkfun's MAG3110 Library
 *  A basic sketch that reads x y and z readings
 *  from the MAG3110 sensor
 *  
 *  George B. on behalf of SparkFun Electronics
 *  Created: Sep 22, 2016
 *  Updated: n/a
 *  
 *  Development Environment Specifics:
 *  Arduino 1.6.7
 *  
 *  Hardware Specifications:
 *  SparkFun MAG3110
 *  Bi-directional Logic Level Converter
 *  Arduino Micro
 *  
 *  This code is beerware; if you see me (or any other SparkFun employee) at the
 *  local, and you've found our code helpful, please buy us a round!
 *  Distributed as-is; no warranty is given.
 *  *********************************************/

#include <SparkFun_MAG3110.h>

MAG3110 mag = MAG3110(); //Instantiate MAG3110

void setup() {
  Serial.begin(9600);

  mag.initialize(); //Initializes the mag sensor
  mag.start();      //Puts the sensor in active mode
}

void loop() {

  int x, y, z;
  //Only read data when it's ready
  if(mag.dataReady()) {
    //Read the data
    mag.readMag(&x, &y, &z);
  
    Serial.print("X: ");
    Serial.print(x);
    Serial.print(", Y: ");
    Serial.print(y);
    Serial.print(", Z: ");
    Serial.println(z);
  
    Serial.println("--------");
  }
}
Error mesages… is not in the form of an error where the compile stops rather it says after compiling
" In RED color.... Warning: library Sparkfun_MAG3110_Breakout_Board_Arduino_Library-master claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (nRF5) architecture(s). "


is there a fix to this?


Cheers..

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”