Question: Help with if touch than stays on and than touch again to stay off. In C //the two lines below make a simple turn-on while
Help with if touch than stays on and than touch again to stay off. In C
//the two lines below make a simple turn-on while still touching, off when not touching //Chnage the code so that with every touch, LED3 toggles and stay
if(touch > touchroom * 0.9) { P2OUT &= ~BIT0; __delay_cycles(200); } // off
if(touch < touchroom * 0.7) { P2OUT |= BIT0; __delay_cycles(200); } // on }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
