Correct use of if and boolean statement?
hi quick question.
i driving servomotor on condition of 2 things.
i want drive continuous rotation servomotor when temperature reaches setpoint want drive until condition changes on 1 of digital inputs e.g. goes low. plan this:
this should drive servo until either digital input goes low or temperature below 25 degrees?
any grealy appreciated.
i driving servomotor on condition of 2 things.
i want drive continuous rotation servomotor when temperature reaches setpoint want drive until condition changes on 1 of digital inputs e.g. goes low. plan this:
code: [select]
if (temp > 25 && digin == high) windowservo.write(90);
this should drive servo until either digital input goes low or temperature below 25 degrees?
any grealy appreciated.
well, if want keep doing something, until criterion no longer true, then need "while" statement, not "if".
but since whole loop( ) function of arduino runs on , over, within while loop outside loop( ) function, so "if" statement here should ok in context.
but since whole loop( ) function of arduino runs on , over, within while loop outside loop( ) function, so "if" statement here should ok in context.
Arduino Forum > Using Arduino > Programming Questions > Correct use of if and boolean statement?
arduino
Comments
Post a Comment