Giter Site home page Giter Site logo

bmi270-spi's People

Contributors

simondlevy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yildiraysabanci

bmi270-spi's Issues

Getting error -9 on example sketch: bmi270_init failed with code -9: CONFIG_LOAD

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);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.