I'm doing an adc read as long as the GPIO is high. But once it enters the if loop it doesn't get automatically updated, I need to reset the GPIO in order to keep it running inside the loop. I have a timer to check and exit after a few seconds. I want to print the voltage continuously but it only prints it once and stops unless I rest the GPIO. What am I doing wrong. Is there any other way of doing it.
void main(){
while(1){
while(interrupt_1){
// interrupt function
}
if(interrupt2){ // check for GPIO high
//adc read
// do calculation
print(volate read);
}
}
}
void main(){
while(1){
while(interrupt_1){
// interrupt function
}
if(interrupt2){ // check for GPIO high
//adc read
// do calculation
print(volate read);
}
}
}