Programmimg errors

Hello everyone, i was making a program and i had a problem on the code but can't see where, can anyone help please?

The error message is this:

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

Here is the code

pinMode (button, INPUT); // vvc pir
pinMode (ledvermelho, OUTPUT);
pinMode (sensor, INPUT);
pinMode (pirPin, INPUT);
}

void loop()
{
int pirVal = digitalRead (pirPin);

digitalWrite (ledvermelho, LOW);

if ( sensor == HIGH);
{
digitalWrite (ledvermelho == LOW);
}

if ( sensor == LOW and button == HIGH and pirVal == HIGH);
{
digitalWrite (ledvermelho == LOW);
}

if ( sensor == LOW and button == LOW and pirVal == HIGH);
{
digitalWrite (ledvermelho == HIGH);
}

if ( sensor == LOW and button == HIGH and pirVal == LOW);
{
digitalWrite (ledvermelho == HIGH);
}

if (sensor == LOW and button == LOW and pirVal == LOW);
{
digitalWrite (ledvermelho == HIGH);
}
}

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you’re using the Arduino Web Editor you will not have access to this useful tool. I recommend you to use the standard IDE instead.

The error message:

too few arguments to function 'void digitalWrite(uint8_t, uint8_t)'

says there’s a problem with your digitalWrite() statements. So let’s have a look at the digitalWrite() reference page:
https://www.arduino.cc/en/Reference/DigitalWrite
Now take a look at the digitalWrite() statements in your code. Do you see the problem?

Compare these digitalWrite (ledvermelho == HIGH); statements with the first one in loop().

if (sensor == LOW and button == LOW and pirVal == LOW);Unlikely the pin number will be equal zero.
Then there's the semicolon . . .

sterretje

why would i compare? i don’t get it

AWOL

the semicolon? what should i do?

i’m new at these, and just learned today how to make a program

why would i compare? i don't get it

Because they are different

the semicolon? what should i do?

Remove it

UKHeliBob:
Because they are different
Remove it

ok so wich one should i change?

i made 4 different states where the LED is supposed to be on or off, depends of the conditions, don't get where the problem is at top

and remove all of them?

If you have made changes to your sketch, you need to repost it again.

Always show us your current compete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

.

Why did you start a new thread with the same errors uncorrected?

Threads merged.

https://www.arduino.cc/en/Reference/DigitalWrite

From your original code.

 digitalWrite (ledvermelho, LOW);

Correct

digitalWrite (ledvermelho == LOW);

Incorrect

thanks, now i could solve it

Put your cursor on the screen after one of the lines that looks like the incorrect example. Press delete until it is gone. Type back in something that looks like the correct example. What's hard about that?