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:
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.


Arduino Forum > Using Arduino > Programming Questions > Correct use of if and boolean statement?


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support