simondlevy / bmi270-spi Goto Github PK
View Code? Open in Web Editor NEWSimple Arduino library for the Bosch BMI270 inertial measurement unit over the SPI bus
License: MIT License
Simple Arduino library for the Bosch BMI270 inertial measurement unit over the SPI bus
License: MIT License
Hello,
Thanks for developing this library, I have been looking for hours for something I could use with my sensor and it seems that this will be perfect for it. I am trying to use the library to connect the MikroE 6DOF IMU 12 Click board to an Arduino Nano Every. I have made the proper connections between the boards and I am running the included Standard example sketch. After flashing, I get the following error in the serial monitor:
bmi270_init failed with code -9: CONFIG_LOAD
Is there some additional configuration file that I should be using? How should I go about fixing this error?
The exact code I'm trying to run is as follows:
/* Read BMI270 sensor via SPI bus
*
* Copyright (c) 2023 Simon D. Levy
*
* MIT License
*
*/
#include <SPI.h>
#include "BMI270.h"
static const uint8_t CS_PIN = 2;
static const uint8_t INT_PIN = 20;
static bool gotInterrupt;
static void handleInterrupt(void)
{
gotInterrupt = true;
}
static BMI270 imu = BMI270(CS_PIN);
static void printval(const int16_t val, const char * label)
{
Serial.print(label);
Serial.print("=");
char tmp[10];
sprintf(tmp, "%+06d ", val);
Serial.print(tmp);
}
void setup(void)
{
Serial.begin(115200);
SPI.begin();
imu.begin();
attachInterrupt(INT_PIN, handleInterrupt, RISING);
}
void loop(void)
{
if (gotInterrupt) {
gotInterrupt = false;
imu.readSensor();
printval(imu.getRawAccelX(), "ax");
printval(imu.getRawAccelY(), "ay");
printval(imu.getRawAccelZ(), "az");
printval(imu.getRawGyroX(), "gx");
printval(imu.getRawGyroY(), "gy");
printval(imu.getRawGyroZ(), "gz");
Serial.println();
}
delay(10);
}
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.