Skip to content

Instantly share code, notes, and snippets.

@tomgidden
Last active November 24, 2017 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomgidden/875b5a5522deeabd9d1ef389607e434a to your computer and use it in GitHub Desktop.
Save tomgidden/875b5a5522deeabd9d1ef389607e434a to your computer and use it in GitHub Desktop.
Espruino Puck.js code for Page-Turn-O-Matic 4000™
@tomgidden
Copy link
Author

This new commit (5) is back to basics (again). It just does an NRF.disconnect(), which should perform NRF.sleep(). It doesn't mess with advertising or anything. It seems to work.

@tomgidden
Copy link
Author

Problems with multiple events led to encapsulating the entire thing in init, adding E.removeAllListeners() and NRF.removeAllListeners(), clearWatch(), etc.

Serial console helped diagnose some issues, but also heisenberged it a bit.

Seems to work now; going to try battery usage again next.

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