i got A error too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'
i have 4 lights connect to A0 till A3 its comming from a remote control (channel selection)
i want to do somting on a spesific channel
see my code i do somthing wrong but i dont now what!
int L1 = A0; // Analog input pin that the potentiometer is attached to
int L2 = A1;
int L3 = A2;
int L4 = A3;
int Down = 8;
int channel = 13;
int sensorValue = 0; // value read from the pot
int sensorValue1 = 0;
int sensorValue2 = 0;
int sensorValue3 = 0;
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(Down, OUTPUT);
pinMode(channel, OUTPUT);
}
char rx_byte = 0;
void loop() {
// read the analog in value:
sensorValue = analogRead(L1);
sensorValue1 = analogRead(L2);
sensorValue2 = analogRead(L3);
sensorValue3 = analogRead(L4);
Serial.print("sensor = " );
Serial.println(sensorValue);
Serial.print("sensor1 = " );
Serial.println(sensorValue1);
Serial.print("sensor2 = " );
Serial.println(sensorValue2);
Serial.print("sensor3 = " );
Serial.println(sensorValue3);
delay(200);
if ( (L1 <= 50) && (L2 <= 50) && (L3 <= 50) && (L4 <= 50)) //condition 1
{
digitalWrite (Down = HIGH);
delay(100);
digitalWrite (Down = LOW);
}
else if ( (L1 >= 50) && (L2 <= 50) && (L3 <= 50) && (L4 <= 50)) //condition 2
{
digitalWrite (channel = HIGH);
delay(100);
digitalWrite (channel = LOW);
}
else if ( (L1 >= 50) && (L2 >= 50) && (L3 <= 50) && (L4 <= 50)) //condition 3
{
digitalWrite (channel = HIGH);
delay(100);
digitalWrite (channel = LOW);
}
else if ( (L1 >= 50) && (L2 >= 50) && (L3 >= 50) && (L4 <= 50)) //condition 4
{
digitalWrite (channel = HIGH);
delay(100);
digitalWrite (channel = LOW);
}
else if ( (L1 >= 50) && (L2 >= 50) && (L3 >= 50) && (L4 = > 50)) //condition 5
{
digitalWrite (channel = HIGH);
delay(100);
digitalWrite (channel = LOW);
}
}