bonjour!
j'ai beau chercher je trouve pas

ça bloque m'exécute que la première instruction...
voici ou en est mon code :
// constants won't change. They're used here to
// set pin numbers:
const int lightPin0 = 0; // Cible n°1 Avant
const int lightPin1 = 1; // Cible n°2 Arrière
const int ledPin0 = 13; // Lumière Cible n°1
const int ledPin1 = 8; // Lumière Cible n°2
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// variables will change:
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // variable for reading the pushbutton status
int lastButtonState = 0; // previous state of the button
int threshold = 250;
void setup() {
Serial.begin(9600); //Begin serial communication
// initialize the LED pin as an output:
pinMode(ledPin0, OUTPUT);
// Lumière cible avant en OUTPUT
pinMode(ledPin1, OUTPUT);
// Lumière cible arrière en OUTPUT
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Gilet num 1");
}
void loop()
{
// compare la valeur de la résistance du photorésistor de "Cible n°1 Avant"
if (analogRead(lightPin0) > threshold)
if (analogRead(lightPin1) > threshold)
{
digitalWrite(8, LOW);
digitalWrite(13, LOW);
// if the current state is LOW then the button
// wend from off to on:
lcd.setCursor(0, 1);
lcd.print("Dead:");
lcd.print(buttonPushCounter);
}
else if (analogRead(lightPin0) > threshold)
{
digitalWrite(8, HIGH);
delay(150);
digitalWrite(8, LOW);
lcd.begin(16, 2);
lcd.print("cible avant");
delay(4000);
buttonPushCounter++;
lcd.print(buttonPushCounter);
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Gilet num 1");
}
else if (analogRead(lightPin1) > threshold)
{
digitalWrite(13, HIGH);
delay(150);
digitalWrite(13, LOW);
lcd.begin(16, 2);
lcd.print("cible arriere");
delay(4000);
buttonPushCounter++;
lcd.print(buttonPushCounter);
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Gilet num 1");
}
}
merci d'avance!