if (fsrReading>500){
shear();
delay(2000);
motorreset();
delay(time);
shearreset();
delay(2000);
motorstop();
shearstop();
}
想实现在满足if条件的时候,先执行shear();两秒后再执行motorreset();按顺序执行,可是为什么实现的结果是循环执行shear(),后面的程不执行?
我在想是不是因为在执行shear()语句时,if条件一直没有变,只有在执行motorreset()后if条件才会变化,所以导致循环执行shear?
想问一下大佬如果想在满足if条件后,想先执行shear,再执行motorreset()以及后面的内容,应该怎么写呢?
shear();
delay(2000);
motorreset();
delay(time);
shearreset();
delay(2000);
motorstop();
shearstop();
}
想实现在满足if条件的时候,先执行shear();两秒后再执行motorreset();按顺序执行,可是为什么实现的结果是循环执行shear(),后面的程不执行?
我在想是不是因为在执行shear()语句时,if条件一直没有变,只有在执行motorreset()后if条件才会变化,所以导致循环执行shear?
想问一下大佬如果想在满足if条件后,想先执行shear,再执行motorreset()以及后面的内容,应该怎么写呢?