imranahmed
Advanced Member level 3
- Joined
- Dec 4, 2011
- Messages
- 817
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,298
- Location
- Karachi,Pakistan
- Activity points
- 6,493
Please let me know can we write long code in External interrupt function "modeChange"
attachInterrupt(digitalPinToInterrupt(interruptPinforEnter), modeChange, FALLING);
I wrote more " if " conditions below " if " condition mode==9 , but whole function could not work when I removed additional conditions I added then it worked.
I want to write another " if " condition.
attachInterrupt(digitalPinToInterrupt(interruptPinforEnter), modeChange, FALLING);
Code:
void modeChange() {
mode++;
if(mode == 9)
{
mode = INIT_MODE;
}
}
I wrote more " if " conditions below " if " condition mode==9 , but whole function could not work when I removed additional conditions I added then it worked.
I want to write another " if " condition.
Code:
void modeChange() {
mode++;
if(mode == 9)
{
mode = INIT_MODE;
}
if(autoLight == 1)
{
lastTimeOut = millis();
lcd.backlight();
lcd.display();
autoLight = 0;
}
}