Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#define MOTOR PORTB.0
unsigned int adc_val;
unsigned int prev_state;
if(adc_val < 60) {
MOTOR = 1;
prev_state = 1;
}
else if(adc_val > 75) {
MOTOR = 0;
prev_state = 0;
}
else if((adc_val >= 60) && (adc_val <=75)) {
MOTOR = prev_state;
}