Skip to content

Include example of how alarm.time() is used in code.py #7743

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

Closed
kattni opened this issue Mar 17, 2023 · 3 comments
Closed

Include example of how alarm.time() is used in code.py #7743

kattni opened this issue Mar 17, 2023 · 3 comments

Comments

@kattni
Copy link

kattni commented Mar 17, 2023

The documentation for alarm.time() should include an example that shows what it looks like in use in code.py. I struggled to figure out how to format it, and ultimately asked for help. I believe this would eliminate potential confusion for others moving forward.

The following explanation and example should be fine to include in the alarm.time() documentation.

This code block sets a delay, creates a TimeAlarm to wake up the board after delay seconds have passed, and then deep sleeps the board until the time alarm is triggered in 30 seconds.

delay = 30  # delay is in seconds
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + delay)
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
@AkshayaVarshieni14
Copy link

im ready to do this

@dhalbert dhalbert modified the milestones: 8.x.x, Long term Apr 14, 2023
@deshipu
Copy link

deshipu commented Jul 29, 2023

@AkshayaVarshieni14 are you still working on it, or is this issue free to be taken by someone else?

@dhalbert
Copy link
Collaborator

Fixed by #10160.

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

No branches or pull requests

4 participants