if statement if condition is met and do until condition is met
i have 2 separate inputs , when if statements match, want wait till condition changes , restart loop again having trouble code wait. if condition 1 met want println(text); until this condition happens (jrx >= 700) restart loop calling loop();
code: [select]
void loop() {
int jrx = analogread(a0);
int mrx = analogread(a5);
serial.print("loop start");
digitalwrite(mptt, low);
digitalwrite(jptt, low);
delay(1000);
if (jrx <= 700) {digitalwrite(mptt, high);}
if (mrx >= 700) {digitalwrite(jptt, high);}
if (jrx <= 700 && mrx >=700){serial.println("no activity");}
}
[ happened code tags? please fix posting use them. ]
i think (not sure) best course of action go , checkout blinkwithoutdelay example
to see how handle delays without calling delay(), see if helps achieve want.
i think (not sure) best course of action go , checkout blinkwithoutdelay example
to see how handle delays without calling delay(), see if helps achieve want.
Arduino Forum > Using Arduino > Programming Questions > if statement if condition is met and do until condition is met
arduino
Comments
Post a Comment