How to cancel a statement within 10 seconds




so have far. want stop autooff running if within 10 seconds accs becomes high. tried put if statement inside of autooff hoping read accs again after delay of 10 seconds still completes sequence. newer , haven't been able find while googling.



code: [select]


  if  (accs == low && pwr2s == high) {     
     autooff();
   }

void autooff() {
  delay(10000)
 
   if  (accs == low && pwr2s == high){
  digitalwrite(pwr1, low);
  digitalwrite(mtrup, high);
  delay (mtr);
  digitalwrite(pwr2, low);

   }
}

your code doesn't compile.


Arduino Forum > Using Arduino > Programming Questions > How to cancel a statement within 10 seconds


arduino

Comments