salut tout le monde.

j'ai récupéré 2 programmes sur internet pour mon arduino. Mais il y a des problèmes dans le premier je n'arrive pas a le téléverser vers ma carte et je ne trouve pas pourquoi.
voici le fameux programme:
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Tone.h>
#include <Timer.h>
#define pound 14
 
Timer counter;
//LiquidCrystal lcd(A5,A4,A3,A2,A1,A0);
LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
 
int DefuseTimer = 0; // set timer to 0
Tone tone1;
int oldS = 0;
int nbBoucle = 0;
 
const int pinWriteDefused = 2;
const int pinWriteBoom = 3;
const int pinReadDefused = 4;
const int pinReadBoom = 5;
 
char password[10]; // number of characters in our password
int currentLength = 0; //defines which number we are currently writing
int i = 0; 
char entered[10];
int passwordLength;
int nbtry = 3;
int currentTry = nbtry;
const int Buzzer = 6;
 
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
 
//Pour les keypad avec la fiche de connection vers le HAUT du clavier :
//byte rowPins[ROWS] = {10, 9, 8, 7}; //connect to the row pinouts of the keypad
//byte colPins[COLS] = {13, 12, 11}; //connect to the column pinouts of the keypad
 
//Pour les keypad avec la fiche de connection vers le BAS du clavier :
byte rowPins[ROWS] = {13, 12, 11, 10}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7}; //connect to the column pinouts of the keypad
 
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
boolean b600s = true;
boolean b300s = true;
boolean b120s = true;
boolean b60s = true;
boolean b30s = true;
boolean b10s = true;
 
 
void setup()
{
  int hours, minutes, seconds;
  lcd.begin(16, 2);
  Serial.begin(9600);
  tone1.begin(Buzzer);
  //pinMode(Buzzer, OUTPUT);
  //digitalWrite(Buzzer, LOW);
  char key;
  boolean cancel;
  do
  {
    cancel = false;
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Time ?");
    lcd.setCursor(4,1);
    //Heures
    hours = readHours();
    if (hours == -1)
      cancel = true;
    else
      lcd.print(":");
 
    //Minutes
    if (cancel == false)
    {
      minutes = readMinutes();
      if (minutes == -1)
        cancel = true;
      else
        lcd.print(":");
    }
 
    //Secondes
    if (cancel == false)
    {
      seconds = readSeconds();
      if (seconds == -1)
        cancel = true;
    }
 
    if (cancel == false)
    {
      do
        key = keypad.waitForKey();
      while (key != '#' && key != '*');
      buttonBip(100);
      if (key == '*')
        cancel = true;
    }
 
  }
  while (cancel == true);
  delay (500);
  counter.setTime(hours, minutes, seconds);
 
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Enter Code: ");
  while ((currentLength < 1 || key != '#'))
  {
    lcd.setCursor(currentLength, 1);
    lcd.cursor();
    key = keypad.getKey();
    if (key != NO_KEY)
    {
      buttonBip(100);
      if (key != '#' && key != '*' && currentLength < 10)
      { 
        lcd.print(key);
        password[currentLength] = key;
        ++currentLength;
        passwordLength = currentLength;
      }
      else if (key == '*')
      {
        lcd.clear();
        lcd.setCursor(0,0);
        lcd.print("Enter Code: ");
        currentLength = 0;
        passwordLength = currentLength;
      }
    }
  }
  Serial.print("rad:bomb:planted");
  delay(500);
  lcd.clear();
  currentLength = 0;
}
 
void loop()
{
  timer();
  currentLength = 0;
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Code: ");
 
  boolean lec_code = true;
  char code[10];
  int i = 0;
  char key2;
 
  while (lec_code == true)
  {
    timer();
 
    key2 = keypad.getKey();
    if (key2 != NO_KEY)
      buttonBip(100);
 
    if (key2 == '#' || i >= 10)
      lec_code = false;
    else if (key2 == '*')
    {
      currentLength = 0;
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Code: ");
    }
    else                  
    if (key2 != NO_KEY && currentLength < 10)    
    {
      entered[currentLength] = key2;
      currentLength++;
      delay(100);
      lcd.noCursor();
      lcd.setCursor(currentLength + 4, 0);
      lcd.print(key2);
      lcd.setCursor(currentLength + 5, 0);
      lcd.cursor();
    }
  }
 
  boolean correct = true;
  for (int j = 0; j < currentLength; ++j)
    if (entered[j] != password[j])
      correct = false;
 
  if (correct == true && passwordLength == currentLength)
  {
    Defused();
  }
  else if (currentLength >= 1)
  {
    lcd.noCursor();
    lcd.clear();
    lcd.home();
    lcd.print("Wrong Password!");
    buttonBip(100);
    delay(200);
    buttonBip(100);
    --currentTry;
    if (currentTry == 0)
      Boom();
    lcd.setCursor(0, 1);
    lcd.print("Try : ");
    lcd.print(currentTry);
    delay(1500);
    currentLength = 0;
 
  }  
}
 
//--------------------------------- Timer --------------------------------
void timer()
{
  if (counter.seconds == 0 && counter.minutes == 10 && counter.hours == 0 && b600s == true) {Serial.print("rad:bomb:600s"); b600s = false;}
  if (counter.seconds == 0 && counter.minutes == 5 && counter.hours == 0 && b300s == true) {Serial.print("rad:bomb:300s"); b300s = false;}
  if (counter.seconds == 0 && counter.minutes == 2 && counter.hours == 0 && b120s == true) {Serial.print("rad:bomb:120s"); b120s = false;}
  if (counter.seconds == 0 && counter.minutes == 1 && counter.hours == 0 && b60s == true) {Serial.print("rad:bomb:60s"); b60s = false;}
  if (counter.seconds == 30 && counter.minutes == 0 && counter.hours == 0 && b30s == true) {Serial.print("rad:bomb:30s"); b30s = false;}
  if (counter.seconds == 10 && counter.minutes == 0 && counter.hours == 0 && b10s == true) {Serial.print("rad:bomb:10s"); b10s = false;}
 
  ++nbBoucle;
  if (((counter.seconds > 10 && counter.minutes < 1 && counter.hours < 1) || (counter.minutes >= 1 || counter.hours >= 1)) && oldS != counter.seconds)
  {
    oldS = counter.seconds;
    timeBip(100); 
  }
  else if (counter.seconds <= 10 && counter.seconds > 5 && counter.minutes < 1 && counter.hours < 1 && nbBoucle >= 15)
  {
    nbBoucle = 0;
    timeBip(100); 
  }
  else if (counter.seconds <= 5 && counter.seconds > 3 && counter.minutes < 1 && counter.hours < 1 && nbBoucle >= 10)
  {
    nbBoucle = 0;
    timeBip(100); 
  }
  else if (counter.seconds <= 3 && counter.minutes < 1 && counter.hours < 1 && nbBoucle >= 5)
  {
    nbBoucle = 0;
    timeBip(100); 
  }
 
  refreshTimeLcd();
 
  if (counter.decrement(millis()))
  {
    Boom ();
  }
  readPort();
  lcd.noCursor();
  delay(10); // waits for a second
  delay(10); // waits for a second
}
 
//--------------------------------- LCD --------------------------------
void refreshTimeLcd()
{
  lcd.setCursor (0,1); // sets cursor to 2nd line
  lcd.print ("Timer:");
  if (counter.hours >= 10)
  {
    lcd.setCursor (7,1);
    lcd.print (counter.hours);
  }
  if (counter.hours < 10) 
  {
    lcd.setCursor (7,1);
    lcd.write ("0");
    lcd.setCursor (8,1);
    lcd.print (counter.hours);
  }
 
  lcd.print (":");
 
  if (counter.minutes >= 10)
  {
    lcd.setCursor (10,1);
    lcd.print (counter.minutes);
  }
  if (counter.minutes < 10) 
  {
    lcd.setCursor (10,1);
    lcd.write ("0");
    lcd.setCursor (11,1);
    lcd.print (counter.minutes);
  }
 
  lcd.print (":");
 
  if (counter.seconds >= 10) 
  {
    lcd.setCursor (13,1);
    lcd.print (counter.seconds);
  }
  if (counter.seconds < 10) 
  {
    lcd.setCursor (13,1);
    lcd.write ("0");
    lcd.setCursor (14,1);
    lcd.print (counter.seconds);
  } 
}
 
//--------------------------------- Heures --------------------------------
int readHours ()
{
  char key;
  char hour[3];
  int hours;
  for (int i=0; i<2; ++i)
  {
    do
    {
      key = keypad.waitForKey();
      if (key != NO_KEY)
        buttonBip(100);
    }
    while (key == NO_KEY || key == '#');
 
    if (key == '*')
      return -1;
 
    hour[i] = key;
    lcd.print(key);
  }
  hour[2] = '\0';
  hours = atoi(hour);
  return hours; 
}
 
//--------------------------------- Minutes --------------------------------
int readMinutes ()
{
  char stTemp[2];
  char key;
  char minute[3];
  int minutes;
  for (int i=0; i<2; ++i)
  {
    do
    {
      key = keypad.waitForKey();
      if (key != NO_KEY)
        buttonBip(100);
      if (key == '*')
        return -1;
      sprintf(stTemp,"%c",key);
    }
    while (key == NO_KEY || key == '*' || key == '#' || ((atoi(stTemp)) >= 6 && i == 0));
    minute[i] = key;
    lcd.print(key);
  }
  minute[2] = '\0';
  minutes = atoi(minute);
  return minutes;
}
 
//--------------------------------- Secondes --------------------------------
int readSeconds ()
{
  char stTemp[2];
  char key;
  char second[3];
  int seconds;
  for (int i=0; i<2; ++i)
  {
    do
    {
      key = keypad.waitForKey();
      if (key != NO_KEY)
        buttonBip(100);
      if (key == '*')
        return -1;
      sprintf(stTemp,"%c",key);
    }
    while (key == NO_KEY || key == '*' || key == '#' || (atoi(stTemp) >= 6 && i == 0));
    second[i] = key;
    lcd.print(key);
  }
  second[2] = '\0';
  seconds = atoi(second);
  return seconds;
}
 
//--------------------------------- Boom -------------------------------------
void Boom ()
{
  Serial.print("rad:bomb:explosed");
  pinMode(pinWriteBoom, OUTPUT);
  digitalWrite(pinWriteBoom, HIGH);
  lcd.noCursor();
  lcd.clear();
  lcd.home();
  lcd.print("The Bomb Has ");
  lcd.setCursor (0,1);
  lcd.print("Exploded!");
  tone1.play(NOTE_F2, 3000);
  delay(8000);
  digitalWrite(3, LOW);
  while (1)
    delay(100000);
}
 
//--------------------------------- Defused ----------------------------------
void Defused ()
{
  Serial.print("rad:bomb:defused");
  pinMode(pinWriteDefused, OUTPUT);
  digitalWrite(pinWriteDefused, HIGH);
  lcd.noCursor();
  lcd.clear();
  lcd.home();
  lcd.print("Bomb Defused");
  refreshTimeLcd();
  buttonBip(200);
  delay(300);
  buttonBip(200);
  delay(300);
  buttonBip(200);
  currentLength = 0;
  while (1)
    delay(1000000);
}
 
//--------------------------------- readPort ----------------------------------
void readPort()
{
  pinMode(pinReadDefused, INPUT);
  pinMode(pinReadBoom, INPUT);
  byte defused = digitalRead(pinReadDefused);
  byte boom = digitalRead(pinReadBoom);
  if (defused == HIGH)
    Defused();
  if (boom == HIGH)
    Boom();
}
 
//---------------------------------- timeBip ---------------------------------
void timeBip (int mills)
{
  tone1.play(NOTE_F7, mills);
}
 
//---------------------------------- buttonBip ---------------------------------
void buttonBip (int mills)
{
  tone1.play(NOTE_A7, mills);
}
il y a ecrit a la fin ce message d'erreur:


Arduino : 1.6.8 (Windows 8.1), Carte : "Arduino/Genuino Uno"

C:\Users\mike\Downloads\bomb_project4_objet\bomb_project4_objet.ino:9:19: fatal error: Timer.h: No such file or directory

 #include <Timer.h>

                   ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.
si vous savez d'ou vient le probleme pouvez vous me dire comme le resoudre.

merci de votre aide