Bonsoir a vous tous,

je suis entrain de travaller sur une projet KONTIKI
, je comence par la partie electronique que je ne maitrise pas, pour ce projet j utilise une HMC5883L avec une arduino uno R3 pour autopiloter cet engin.

j ai trouer sur le net un programme identique a mon projet seulement aue je suis bloqué avec une erreur de compilation. Voici le code et l erreur

Code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
#include <Wire.h>
#include "HMC5883L.h"
#include <Servo.h> 
 
#define SERVO  9
#define CENTER 100
#define GOAL   0
 
HMC5883L compass;
int      goal = GOAL;
float    declinationAngle = 0.212;    // Radians
Servo    myservo;
 
 
void setup() {
 
 
Serial.begin(9600);
myservo.attach(SERVO);
Wire.begin();
compass = HMC5883L();
// Set scale to +/- 1.3 Ga
int error = compass.SetScale(1.3);
if (error != 0)
 Serial.println(compass.GetErrorText(error));
// Set measurement mode to continous
error = compass.SetMeasurementMode(Measurement_Continuous);
if (error != 0)
 Serial.println(compass.GetErrorText(error));
}
 
void loop() {
 
int angle = getDegrees();
int error = goal - angle;
if (error >= 180)
 error -= 360;
if (error <= -180)
 error += 360;
// Update servo and keep with range of +/- 60
if (error > 60)
 error = 60;
if (error < -60)
 error = -60;
myservo.write(CENTER + error);
delay(10);
}
 
int getDegrees () {
MagnetometerScaled scaled = compass.ReadScaledAxis();
// Calculate heading when the magnetometer is level, then correct for signs of axis.
float heading = atan2(scaled.YAxis, scaled.XAxis) + declinationAngle;
// Correct for when signs are reversed.
if(heading < 0)
 heading += 2 * PI;
// Check for wrap due to addition of declination.
if(heading > 2 * PI)
 heading -= 2 * PI;
// Convert radians to degrees for readability.
return (int)  (heading * 180 / M_PI); 
}
ERREUR:

C:\Users\DICH\Documents\Arduino\Dichtiki\HMC5883L_Example.ino:18:22: fatal error: HMC5883L.h: No such file or directory

#include <HMC5883L.h>

^

compilation terminated.

exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno


Merci d avance pour votre aide