I have problem with the if statment

I have a problem with an if statment the if statment contains "pinMode(8, OUTPUT)" whick requiers (',') or (';') in front of it this the anplies to the if statment i have tried fixing the problem by puting (',') or (';'), but then it says there needs to be (',') or (';') in front of (',') or (';').

Thank you for reading, Slo2009 dev - Urban Šaljaj

Can you show the code? I am pretty sure pinMode(8, OUTPUT); shouldn't be in an if statement, it should be in void setup(). Any command should have a semicolon ";" after it, i.e. pinMode(8, OUTPUT);

There's no reason a pinMode shouldn't in an if, and it doesn't have to be in setup eithet..

But let's wait for the OP to quit hand-waving, and just post the code.

I fixed the problem i forgot to put ; in the previus line but stil

thanks for reaplying, Slo2009 dev - Urban Šaljaj

pinMode should not be in the condition of the if statement, since it does not return any value, but can be in the code executed within an if or else statement.

I fixed the problem i forgot to put ; in the previus line but still

thanks for reaplying, Slo2009 dev - Urban Šaljaj

@slo2009_dev, your topic has been moved to a more suitable location on the forum.

In future, if you have a coding problem, please show your code (and use code tags for that as described in How to get the best out of this forum).

You can mark a topic as 'solved' by clicking the solution checkbox under the most useful reply; that way people who encounter the same problem know that there was a solution :wink:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.