alung92 WROTE:my coding was regarding about a rain sensor to active the rotation of motor with 2 limit switch connecting to same digital inout , but i facing the problem which 2 condition can interact both condition (if.....else). the motor start confuse , keep reverse and forward. plz someone help me solve this problem for me . i need end the first condition statement before proceed to next statement. Even thou i used while(1), it's didn't working.
Agreed with Idris, try part by part, narrow down the possible error. When you combine everything, it is difficult to troubleshoot.
Make sure 1 part is working correct, add a little small part and make sure the additional part is working on top of the previous part. When the output is not working as expected, troubleshoot the additional part.