I am having an issue with my code. The ide keeps saying: too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'.
My code is:
int red = 3;
int yellow = 5;
int green = 8;
int blue = 13;
int activate = 7;
void setup() {
// put your setup code here, to run once:
pinMode(activate, INPUT_PULLUP);
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(activate) == HIGH)
{
digitalWrite(green) == LOW);
digitalWrite(yellow) == HIGH);
delay(3000);
digitalWrite(yellow) == LOW);
digitalWrite(red) == HIGH);
}
else if (digitalRead(activate) == LOW)
{
digitalWrite(green) == HIGH);
digitalWrite(blue) == LOW);
digitalWrite(red) == LOW);
digitalWrite(yellow) == LOW);
}
}
I am using the UNO board
I am using 5 led's(one red, one yellow, one green, two blue), five 220ohm resistors(one per LED), and one button.
Pin setup:
the two blue led's to pin 13
red led to pin 3
yellow led topin 5
green led to pin 8
button(activate in code) to pin 7
Did i code it wrong? Does anybody know the solution? I tried the else if as an if function already.
(For fun, I atached the blue led's to pin D13 to see the board led blink [Uno prototype shield atached.])