Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente | |||
| depannage_bno055 [2021/08/17 17:19] – buched | depannage_bno055 [2021/11/27 13:24] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== AgOpenGPS ====== | ||
| + | ===== Dépannage du BNO===== | ||
| + | |||
| + | ===== Préparation ===== | ||
| + | |||
| + | Pour certains, le BNO055 n’est pas reconnu dans le logiciel AgOpenGPS. Il y a plusieurs causes\\ | ||
| + | et ce document ne traitera que de l’aspect " | ||
| + | Causes possibles :\\ | ||
| + | - Mauvais branchements\\ | ||
| + | - BNO défectueux\\ | ||
| + | - Mauvaises soudures\\ | ||
| + | - Mauvaise adresse I2C\\ | ||
| + | |||
| + | ====== Préparatifs ====== | ||
| + | |||
| + | Arduino IDE\\ | ||
| + | Pour commencer, ouvrez l' | ||
| + | Cherchez Adafruit Unified Sensor et installez la dernière version\\ | ||
| + | \\ | ||
| + | {{ :: | ||
| + | Ensuite, cherchez Adafruit bno055 et installez le aussi.\\ | ||
| + | {{ : | ||
| + | Ensuite, créez un nouveau sketch et collez ce code à l' | ||
| + | < | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | Adafruit_BNO055 bno = Adafruit_BNO055(55); | ||
| + | |||
| + | void setup(void) | ||
| + | { | ||
| + | Serial.begin(9600); | ||
| + | Serial.println(" | ||
| + | |||
| + | /* Initialise the sensor */ | ||
| + | |||
| + | if(!bno.begin()) | ||
| + | { | ||
| + | /* There was a problem detecting the BNO055 ... check your connections */ | ||
| + | Serial.print(" | ||
| + | while(1); | ||
| + | } | ||
| + | |||
| + | delay(1000); | ||
| + | |||
| + | bno.setExtCrystalUse(true); | ||
| + | } | ||
| + | |||
| + | void loop(void) | ||
| + | { | ||
| + | /* Get a new sensor event */ | ||
| + | sensors_event_t event; | ||
| + | bno.getEvent(& | ||
| + | |||
| + | /* Display the floating point data */ | ||
| + | Serial.print(" | ||
| + | Serial.print(event.orientation.x, | ||
| + | Serial.print(" | ||
| + | Serial.print(event.orientation.y, | ||
| + | Serial.print(" | ||
| + | Serial.print(event.orientation.z, | ||
| + | Serial.println("" | ||
| + | |||
| + | delay(100); | ||
| + | } | ||
| + | </ | ||
| + | \\ | ||
| + | Televersez le dans votre Nano et ouvrez le moniteur série avec une vitesse de 9600 bauds.\\ | ||
| + | Si Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!\\ | ||
| + | c’est qu’il vous faut trouvez la bonne adresse I2C.\\ | ||
| + | \\ | ||
| + | --- // | ||
| + | ====== Adresse I2C ====== | ||
| + | |||
| + | Pour trouvez l’adresse I2C, vous allez televerser un scanner I2C dans le nano.\\ | ||
| + | prennez le code, | ||
| + | < | ||
| + | // -------------------------------------- | ||
| + | // i2c_scanner | ||
| + | // | ||
| + | // Version 1 | ||
| + | // This program (or code that looks like it) | ||
| + | // can be found in many places. | ||
| + | // For example on the Arduino.cc forum. | ||
| + | // The original author is not know. | ||
| + | // Version 2, Juni 2012, Using Arduino 1.0.1 | ||
| + | // | ||
| + | // Version 3, Feb 26 2013 | ||
| + | // V3 by louarnold | ||
| + | // Version 4, March 3, 2013, Using Arduino 1.0.3 | ||
| + | // by Arduino.cc user Krodal. | ||
| + | // Changes by louarnold removed. | ||
| + | // Scanning addresses changed from 0...127 to 1...119, | ||
| + | // according to the i2c scanner by Nick Gammon | ||
| + | // https:// | ||
| + | // Version 5, March 28, 2013 | ||
| + | // As version 4, but address scans now to 127. | ||
| + | // A sensor seems to use address 120. | ||
| + | // Version 6, November 27, 2015. | ||
| + | // Added waiting for the Leonardo serial communication. | ||
| + | // | ||
| + | // | ||
| + | // This sketch tests the standard 7-bit addresses | ||
| + | // Devices with higher bit address might not be seen properly. | ||
| + | // | ||
| + | |||
| + | #include < | ||
| + | |||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | Wire.begin(); | ||
| + | |||
| + | Serial.begin(9600); | ||
| + | while (!Serial); | ||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | |||
| + | void loop() | ||
| + | { | ||
| + | byte error, address; | ||
| + | int nDevices; | ||
| + | |||
| + | Serial.println(" | ||
| + | |||
| + | nDevices = 0; | ||
| + | for(address = 1; address < 127; address++ ) | ||
| + | { | ||
| + | // The i2c_scanner uses the return value of | ||
| + | // the Write.endTransmisstion to see if | ||
| + | // a device did acknowledge to the address. | ||
| + | Wire.beginTransmission(address); | ||
| + | error = Wire.endTransmission(); | ||
| + | |||
| + | if (error == 0) | ||
| + | { | ||
| + | Serial.print(" | ||
| + | if (address< | ||
| + | Serial.print(" | ||
| + | Serial.print(address, | ||
| + | Serial.println(" | ||
| + | |||
| + | nDevices++; | ||
| + | } | ||
| + | else if (error==4) | ||
| + | { | ||
| + | Serial.print(" | ||
| + | if (address< | ||
| + | Serial.print(" | ||
| + | Serial.println(address, | ||
| + | } | ||
| + | } | ||
| + | if (nDevices == 0) | ||
| + | Serial.println(" | ||
| + | else | ||
| + | Serial.println(" | ||
| + | |||
| + | delay(5000); | ||
| + | } | ||
| + | </ | ||
| + | téléversez le et ouvrez le moniteur série en 9600 bauds et vous devriez trouver 1 ou plusieurs périphériques I2C.\\ | ||
| + | l’idéal est de ne laisser branché que le BNO pour ne trouver qu’une seule adresse\\ | ||
| + | {{ :: | ||
| + | \\ | ||
| + | Modifications dans le code AgOpenGPS\\ | ||
| + | Maintenant il suffit d’ouvrir le code de AgOpenGPS et modifier comme sur la photo l’adresse et la lettre puis de téléverser à nouveau dans le Nano. Maintenant AgOpenGPS devrait le reconnaître\\ | ||
| + | {{ : | ||
| + | |||
| + | ---- | ||
| + | Crédits : Manu COUVERCELLE | ||