Hi,
I am using an Arduino DUE and when reading the state of a pin it shows it is positive and negative.
I have just an external Pull Down to force 0v in the pin.
What else could be causing this?
Hi,
I am using an Arduino DUE and when reading the state of a pin it shows it is positive and negative.
I have just an external Pull Down to force 0v in the pin.
What else could be causing this?
Okay, I found the error.
"I'm such a Genius!!"
It is the ; next to the if statement
if(); // <- this one!!
{
}
Review the syntax of an if() statement in C.
You have a ; after the if() statement. when an if() is true, it does the next statement or block, and then continues from the next line after that. When you put the ; at the end of the line with the if(), that counts as the statement, so the block afterwards is executed regardless of whether the if() condition is true.
Will do, thanks DrAzzy
F1_:
Okay, I found the error.
"I'm such a Genius!!"It is the ; next to the if statement
if(); // <- this one!!
{
}
F1_:
Okay, I found the error.
"I'm such a Genius!!"It is the ; next to the if statement
if(); // <- this one!!
{
}
There are four cases of software / coding errors
1 Typos
2 Syntax errors
3 Logical errors
4 Old age
I hope in your case 2 and 3 , in my ALL of the above - mostly in reverse order.
Good luck coding.
.