This is the kind of tiny board I have. It says MPU 92/65 on the board, and the description says its SPI/IIC MPU-9250 9-Axis Attitude +Gyro+Accelerator+Magnetometer Module A2TM
Ok so how to make it run? I found its at 0x68. I followed the youtube video at How to use MPU-9250 Gyroscope, Accelerometer, Magnetometer for Arduino - YouTube
if I run ANY MPU-9250 example program it reports NO MPU found.
Ran close to 20 different examples now, or more, only 1 sort of worked, /* BurstRead_demo.ino
/*
*
- Copyright (c) 2019 Seeed Technology Co., Ltd.
- Website : www.seeed.cc
- Create Time: February 2019
- Change Log :
#include <Seeed_ADIS16470.h>
#include <Wire.h>
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define SERIAL SerialUSB
#else
#define SERIAL Serial
#endif
uint8_t burstdata[21];
uint16_t *wordData;
// Accelerometer
float AXS, AYS, AZS = 0;
// Gyro
float GXS, GYS, GZS = 0;
// Temperature
float TEMPS = 0;
// Call ADIS16470 Class
ADIS16470 IMU(10);
void scaleData() {
GXS = IMU.gyroScale(*(wordData + 1)); //Scale X Gyro
GYS = IMU.gyroScale(*(wordData + 2)); //Scale Y Gyro
GZS = IMU.gyroScale(*(wordData + 3)); //Scale Z Gyro
// AXS = IMU.accelScale(*(wordData + 4)); //Scale X Accel
// AYS = IMU.accelScale(*(wordData + 5)); //Scale Y Accel
// AZS = IMU.accelScale(*(wordData + 6)); //Scale Z Accel
// TEMPS = IMU.tempScale(*(wordData + 7)); //Scale Temp Sensor
}
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
SERIAL.begin(9600); // start serial for output
}
void loop()
{
Wire.requestFrom(0x68, 21); // request 10 bytes + Version from slave device 0x36
int i=0;
while (Wire.available()) { // slave may send less than requested
uint8_t c = Wire.read(); // receive a byte as character
burstdata[i] = c;
i++;
//SERIAL.print(c,HEX);
//SERIAL.print(" ");
}
i = 0;
wordData = IMU.wordData(burstdata);
scaleData();
//print the array of burstread and checksum
/*
int s = 0;
uint32_t burstChecksum = 0;
for(int i = 0; i < 21; i++)
{
if(i < 18)
{
s += burstdata[i];
}
else
{
burstChecksum = s;
}
SERIAL.print(burstdata[i], HEX);
SERIAL.print(" ");
if(i%5 == 0)SERIAL.println();
}
SERIAL.print("checksum: ");
SERIAL.println(burstChecksum, HEX);
*/
// SERIAL.print("Version:v");
// SERIAL.println(burstdata[20]);
// Print scaled gyro data
SERIAL.print("XGYRO(degrees/sec): ");
SERIAL.println(GXS);
SERIAL.print("YGYRO(degrees/sec): ");
SERIAL.println(GYS);
SERIAL.print("ZGYRO(degrees/sec): ");
SERIAL.println(GZS);
// // Print scaled accel data
// SERIAL.print("XACCL(g's): ");
// SERIAL.println(AXS);
// SERIAL.print("YACCL(g's): ");
// SERIAL.println(AYS);
// SERIAL.print("ZACCL(g's): ");
// SERIAL.println(AZS);
// SERIAL.println(" ");
//
// // Print Status Registers
// SERIAL.print("DIAG_STAT: ");
// SERIAL.println((*(wordData + 0)));
// SERIAL.print("TIME_STMP: ");
// SERIAL.println((*(wordData + 8)));
// SERIAL.print("CHECKSUM: ");
// SERIAL.println((*(wordData + 9)));
SERIAL.println();
SERIAL.println();
delay(1000);
}
And this runs and will post a bunch of numbers, then all 0's then touch the board and it posts a bunch of other numbers? oh working? no. let the board sit and it does this, zero's then random numbers, then zeros.
I just had this board in a kit and wanted to try out I2C things, not terribly important, just that it seems like after 2 full days of trying it would work
WIRING:
VCC = 5v
GND = GND
SDA = SDA
SCL = SCL (the 2 pins near the reset button on UNO R3 board)
all others open.
This will reliably detect I2C at 0x68 as the youtube video says, some programs confirm this, but wondering what is the correct library or example to use with this? thanks