Lidar Adafruit

Bonjour,

Je viens d'acheter le lidar VL53L0X d'adafruit. J'ai suivi le tuto Adafruit pour la connexion du capteur et pour le chargement de la librairie.

Je charge le programme exemple dans l IDE arduino et quand je veux le televerser, il me dit erreur de compilation.

J'arrive pas a savoir pourquoi. C'est un capteur qui fonctionne en I2C et il n'y a pas la librarie Wire dans le code exmple, bizarre, mais meme si je le rajoute j'ai toujours le message d'erreur.

J'ai deja utilisé des capteurs Adafruit et je n'ai jamais eu ce genre de probleme.

Pouvez vous m'aider, MERCI

Message d'erreur :

In file included from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:23:18: error: Wire.h: No such file or directory
In file included from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_device.h:37,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_def.h:90,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_api_strings.h:32,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_api.h:32,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:24,
                 from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_types.h:75: error: conflicting declaration 'typedef unsigned int uint32_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:126: error: 'uint32_t' has a previous declaration as 'typedef long unsigned int uint32_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_types.h:80: error: conflicting declaration 'typedef int int32_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:125: error: 'int32_t' has a previous declaration as 'typedef long int int32_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_types.h:85: error: conflicting declaration 'typedef short unsigned int uint16_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:124: error: 'uint16_t' has a previous declaration as 'typedef unsigned int uint16_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/vl53l0x_types.h:90: error: conflicting declaration 'typedef short int int16_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:123: error: 'int16_t' has a previous declaration as 'typedef int int16_t'
In file included from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:40: error: ISO C++ forbids initialization of member 'Status'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:40: error: making 'Status' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:40: error: ISO C++ forbids in-class initialization of non-const static member 'Status'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:44: error: 'Adafruit_VL53L0X::MyDevice' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:44: error: `&' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:44: error: ISO C++ forbids initialization of member 'pMyDevice'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:44: error: making 'pMyDevice' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:44: error: invalid in-class initialization of static data member of non-integral type 'VL53L0X_Dev_t*'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:46: error: 'Adafruit_VL53L0X::Version' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:46: error: `&' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:46: error: ISO C++ forbids initialization of member 'pVersion'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:46: error: making 'pVersion' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X-master/src/Adafruit_VL53L0X.h:46: error: invalid in-class initialization of static data member of non-integral type 'VL53L0X_Version_t*'

et le programme exemple :

#include "Adafruit_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
  Serial.begin(115200);

  // wait until serial port opens for native USB devices
  while (! Serial) {
    delay(1);
  }
  
  Serial.println("Adafruit VL53L0X test");
  if (!lox.begin()) {
    Serial.println(F("Failed to boot VL53L0X"));
    while(1);
  }
  // power 
  Serial.println(F("VL53L0X API Simple Ranging example\n\n")); 
}


void loop() {
  VL53L0X_RangingMeasurementData_t measure;
    
  Serial.print("Reading a measurement... ");
  lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!

  if (measure.RangeStatus != 4) {  // phase failures have incorrect data
    Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
  } else {
    Serial.println(" out of range ");
  }
    
  delay(100);
}

hello je viens de tester en 1.6.12 le code d'exemple compile

il y a un détail qui apparaît dans ton message d'erreur Arduino/libraries/Adafruit_VL53L0X-master/s

peux tu renomer la librairie que tu as copiée dans le dossier "librairies" de ton IDE arduino

de Adafruit_VL530X-master

tu cliques droit sur le dossier et tu sélectionnes "renommer" dans la liste

puis tu laisses Adafruit_VL530X et tu supprimes "-master"

tu fermes l'IDE Arduino et tu l'ouvres à nouveau

tu recharge l'exemple et tu compiles.

Merci de ta reponse, mais j’ai toujours le message d’erreur.

Auriez vous une idée d’ou vient le problème.

In file included from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:23:18: error: Wire.h: No such file or directory
In file included from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_device.h:37,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_def.h:90,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_api_strings.h:32,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_api.h:32,
                 from /Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:24,
                 from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_types.h:75: error: conflicting declaration 'typedef unsigned int uint32_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:126: error: 'uint32_t' has a previous declaration as 'typedef long unsigned int uint32_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_types.h:80: error: conflicting declaration 'typedef int int32_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:125: error: 'int32_t' has a previous declaration as 'typedef long int int32_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_types.h:85: error: conflicting declaration 'typedef short unsigned int uint16_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:124: error: 'uint16_t' has a previous declaration as 'typedef unsigned int uint16_t'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_types.h:90: error: conflicting declaration 'typedef short int int16_t'
/Users/leveque/Desktop/Arduino-1.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdint.h:123: error: 'int16_t' has a previous declaration as 'typedef int int16_t'
In file included from vl53l0x.ino:1:
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:40: error: ISO C++ forbids initialization of member 'Status'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:40: error: making 'Status' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:40: error: ISO C++ forbids in-class initialization of non-const static member 'Status'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:44: error: 'Adafruit_VL53L0X::MyDevice' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:44: error: `&' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:44: error: ISO C++ forbids initialization of member 'pMyDevice'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:44: error: making 'pMyDevice' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:44: error: invalid in-class initialization of static data member of non-integral type 'VL53L0X_Dev_t*'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:46: error: 'Adafruit_VL53L0X::Version' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:46: error: `&' cannot appear in a constant-expression
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:46: error: ISO C++ forbids initialization of member 'pVersion'
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:46: error: making 'pVersion' static
/Users/leveque/Documents/Arduino/libraries/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:46: error: invalid in-class initialization of static data member of non-integral type 'VL53L0X_Version_t*'

@dfgh Ou as tu récupéré le code exemple ?

Moi je suis en release 1.0.0 du Feb 13, 2017

Merci

greg06:
@dfgh
Ou as tu récupéré le code exemple ?

Moi je suis en release 1.0.0 du Feb 13, 2017

Merci

bonsoir
quelle version d’IDE arduino ?
Quel OS ?

sur 1.6.4

fichier exemples EPROM