je suis novice et j'ai besoins d'un coup de pouce

Bonjour j'ai un petit projet perso "db mètre " j'ai utiliser un code deja fait :

mais en le modifiant j'arrive a avoir des erreurs :

Arduino : 1.8.4 (Windows 10), Carte : "Arduino/Genuino Uno"

C:\Users\Mrlog42\Desktop\Dose_Le_Son.V.2\Code\Code led\Code_LED\Code_LED.ino: In function 'void soundISR()':

Code_LED:22: error: too many arguments to function 'void digitalWrite(uint8_t, uint8_t)'

   digitalWrite (PIN_LED_R, PIN_LED_V, PIN_LED_J, pin_val);   

                                                         ^

In file included from sketch\Code_LED.ino.cpp:1:0:

C:\Users\Mrlog42\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino/Arduino.h:134:6: note: declared here

 void digitalWrite(uint8_t, uint8_t);

      ^

C:\Users\Mrlog42\Desktop\Dose_Le_Son.V.2\Code\Code led\Code_LED\Code_LED.ino: In function 'void loop()':

Code_LED:55: error: 'PIN_LED_j' was not declared in this scope

     digitalWrite(PIN_LED_j,LOW);

                  ^

Code_LED:56: error: 'PIN_LED_r' was not declared in this scope

     digitalWrite(PIN_LED_r,LOW);

                  ^

Code_LED:63: error: 'PIN_LED_j' was not declared in this scope

     digitalWrite(PIN_LED_j,HIGH);

                  ^

Code_LED:64: error: 'PIN_LED_r' was not declared in this scope

     digitalWrite(PIN_LED_r,LOW);

                  ^

Code_LED:70: error: 'PIN_LED_j' was not declared in this scope

     digitalWrite(PIN_LED_j,HIGH);

                  ^

Code_LED:71: error: 'PIN_LED_r' was not declared in this scope

     digitalWrite(PIN_LED_r,HIGH);

                  ^

exit status 1
too many arguments to function 'void digitalWrite(uint8_t, uint8_t)'

le code en question :

 /******************************************************************************
 * GND → GND
 * VCC → 5V
 * Gate → Pin 2
 * Envelope → A0
 * ledr 12
 * ledj 10
 * ledv 11
 ******************************************************************************/

 // Define hardware connections
#define PIN_GATE_IN 2
#define IRQ_GATE_IN  0
#define  PIN_LED_R  12
#define  PIN_LED_V  11
#define  PIN_LED_J  10
#define PIN_ANALOG_IN A0

void soundISR()
{
  int pin_val;
  
  pin_val = digitalRead(PIN_GATE_IN);
  digitalWrite (PIN_LED_R, PIN_LED_V, PIN_LED_J, pin_val);   //l'erreur est sur cette ligne!!
}

void setup()
{
  Serial.begin(9600);
  
  //  Configure LED pin as output
  pinMode(PIN_LED_R, OUTPUT);
    pinMode(PIN_LED_V, OUTPUT);
      pinMode(PIN_LED_J, OUTPUT);
      
  // configure input to interrupt
  pinMode(PIN_GATE_IN, INPUT);
  attachInterrupt(IRQ_GATE_IN, soundISR, CHANGE);

  // Display status
  Serial.println("Initialized");
}

void loop()
{
  int value;
  
  // Check the envelope input
  value = analogRead(PIN_ANALOG_IN);
  
  // Convert envelope value into a message
  Serial.print("Status: ");
  if(value <= 10)
  {
    Serial.println("Quiet.");
    digitalWrite(PIN_LED_V,HIGH);
    digitalWrite(PIN_LED_j,LOW);
    digitalWrite(PIN_LED_r,LOW);
    
  }
  else if( (value > 10) && ( value <= 30) )
  {
    Serial.println("Moderate.");
    digitalWrite(PIN_LED_V,HIGH);
    digitalWrite(PIN_LED_j,HIGH);
    digitalWrite(PIN_LED_r,LOW);
  }
  else if(value > 30)
  {
    Serial.println("Loud.");
    digitalWrite(PIN_LED_V,HIGH);
    digitalWrite(PIN_LED_j,HIGH);
    digitalWrite(PIN_LED_r,HIGH);
  }
}

merci d'avance

ciao les makers

01000100 01101001 01110100 01100101 01110011 00100000 01101101 01101111 01101110 00100000 01101110 01101111 01101101 00100000 00101000 01101000 01100101 01101001 01110011 01100101 01101110 01100010 01100101 01110010 01100111 00101001 00100000 00101000 01000010 01110010 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01000010 01100001 01100100 00101001

digitalWrite (PIN_LED_R, PIN_LED_V, PIN_LED_J, pin_val);

2 arguments : digitalWrite(pin, value);

comme ici
digitalWrite(PIN_LED_V,HIGH);
digitalWrite(PIN_LED_j,HIGH);
digitalWrite(PIN_LED_r,HIGH);

dans ta logique tu aurais du écrire :

digitalWrite (PIN_LED_R, PIN_LED_V, PIN_LED_J, HIGH); //erreur

bref tu remplaces digitalWrite (PIN_LED_R, PIN_LED_V, PIN_LED_J, pin_val);

par
digitalWrite(PIN_LED_V,pin_val);
digitalWrite(PIN_LED_J,pin_val);
digitalWrite(PIN_LED_R,pin_val);

attention LED_j et LED_J LED_r et LED_R : ce n'est pas la meme chose tu auras erreurs

Merci :slight_smile: