drcpattison / icm-20948 Goto Github PK
View Code? Open in Web Editor NEWICM-20948 port of the MPU-9250 Kris Winer Arduino library
License: MIT License
ICM-20948 port of the MPU-9250 Kris Winer Arduino library
License: MIT License
HI, thanks for sharing.
I have those compilation issues, and was wondering if you can help. Thanksπ
ICM20948BasicAHRS_I2C:202:165: error: 'MahonyQuaternionUpdate' was not declared in this scope
MahonyQuaternionUpdate(myIMU.ax, myIMU.ay, myIMU.az, myIMU.gx * DEG_TO_RAD,myIMU.gy * DEG_TO_RAD, myIMU.gz * DEG_TO_RAD,myIMU.my, myIMU.mx, myIMU.mz, myIMU.deltat);
^
ICM20948BasicAHRS_I2C:272:52: error: 'getQ' was not declared in this scope
Serial.print("q0 = "); Serial.print(getQ());
^
ICM20948BasicAHRS_I2C:294:42: error: 'getQ' was not declared in this scope
myIMU.yaw = atan2(2.0f * ((getQ()+1) * *(getQ()+2) + *getQ()
Connected dpeng icm20948 via SDA and SCL to similar ports on Due (20 and 21).
Sketch compiles and downloads OK but no print output (connected via due programming port).
Serial print of gyro data works using other sketches with exactly the same hardware.
Is there any obvious reasons why I'm not getting any data out?
I had problem compiling the above section for the nrf52DK , but manage to fix all the problems / warning π
1: replace return NULL by return 0
uint8_t ICM20948::writeByteWire(uint8_t deviceAddress, uint8_t registerAddress,
uint8_t data)
{
Wire.beginTransmission(deviceAddress); // Initialize the Tx buffer
Wire.write(registerAddress); // Put slave register address in Tx buffer
Wire.write(data); // Put data in Tx buffer
Wire.endTransmission(); // Send the Tx buffer
// TODO: Fix this to return something meaningful
//return NULL;
return 0;
}
2: replace int16_t mag_max[3] ... by int32_t mag_max[3] (0x8000 don't like uint_16 but 0x7FFF is OK);
void ICM20948::magCalICM20948(float * bias_dest, float * scale_dest)
{
uint16_t ii = 0, sample_count = 0;
int32_t mag_bias[3] = {0, 0, 0},
mag_scale[3] = {0, 0, 0};
int32_t mag_max[3] = {0x8000, 0x8000, 0x8000}, mag_min[3] = {0x7FFF, 0x7FFF, 0x7FFF};
int16_t mag_temp[3] = {0, 0, 0};
//int16_t mag_max[3] = {0x7FFF, 0x7FFF, 0x7FFF}, mag_min[3] = {0x7FFF, 0x7FFF, 0x7FFF}, mag_temp[3] = {0, 0, 0};
I might have change something else, I dont remember. I got the first part of the program working, I will try to fix the other issue later.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.