Below is simple 9 byte program. I wrote it while doing low power tests.
R1 127: 8M L0H S1 LPR1: EOP
A brief explanation of whats going on:
- R1 127 (Set register 1 to value of 127)
- : (Expression Seperator symbol)
- 8M (Deep Sleep 8 minute)
- L0H (Set LED 0 Pin High)
- S1 (Delay 1 Second)
- LPR1 (Loop expression the amount of times equal to value of register 1)
- : (Expression Seperator symbol)
- EOP (End of program code, not really needed but could prevent issues...)
This program will sleep for 8 minutes, flash LED for 1 second, then sleep for 8 minutes, and repeat 127 times... or ~17 hours!
There is an OP for setting LED low, and I originally wrote this like: deepsleep,led on sleep 1 sec, led off, sleep one sec, loop. But then I realized the devices function for going into deepsleep changes all pins to input pull_down. So there is no need to call L0L (OP for setting LED 0 low, yeah i know... lol) if the next OP is a deep sleep call.
Below is the binary code for the program:
1000 0001 0111 1111 1111 1111 1011 1000 1101 0100 1001 0001 1010 0001 1111 1111 1000 0000
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.