 }
 
 void loop() {
-  if (periode>16000000){
+  if (periode>1600){
     voltmetre();
     periode=0;
     //Serial.println("loop");

void setup() {
  Serial.begin(9600);
  voltmetre();
  Serial.print("Voltage = ");Serial.print(voltage);Serial.println(" V ");Serial.println();
  
  
  if (voltage<6.5) 
  {
    Serial.println("CRITICAL ERROR : BATTERY TOO LOW !");
    while(1);
  }
  

void stillLED(){
  analogWrite(pinLED,250);
}


/*************** softPWM  ***************/ 
void softPWM(int pin, int dutyCycle/* Percentage */) {
  currentMicros = micros(); //Time elapsed since the start of the start of the programm
  if (currentMicros - previousMicros <= dutyCycle*period/100) {
    digitalWrite(pin,HIGH);
    Serial.println("ON");
  }
  else {
    if ( currentMicros - previousMicros <= period) {
      digitalWrite(pin, LOW);
      Serial.println("OFF");    
    }
    else {
      digitalWrite(pin, HIGH);
      Serial.println("ON");
      previousMicros = currentMicros;
    }
  }  
}

