Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arduino sleep function is failed #13

Open
zczc366 opened this issue Mar 8, 2022 · 1 comment
Open

arduino sleep function is failed #13

zczc366 opened this issue Mar 8, 2022 · 1 comment

Comments

@zczc366
Copy link

zczc366 commented Mar 8, 2022

the code for AVR:

set_sleep_mode(SLEEP_MODE_STANDBY);
sleep_enable();
sleep_mode();

modify the code to debug for LGT:

Serial.println(millis());
delay(100);
set_sleep_mode(SLEEP_MODE_STANDBY);
sleep_mode();
Serial.println("pass");
delay(1000);
inSleep();

the result:

11500
pass
12801
pass
14101
pass
15401
pass

@zczc366
Copy link
Author

zczc366 commented Mar 9, 2022

problem sovled,LGT sleep function can't work in "attachInterrupt CHANGE" mode:
change
attachInterrupt(0, function, CHANGE);
to
attachInterrupt(0, function, FALLING);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant