Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:3208dcf3974f, committed 2016-09-22
- Comitter:
- Helmut64
- Date:
- Thu Sep 22 13:05:35 2016 +0000
- Commit message:
- Updated test deepsleep;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 22 13:05:35 2016 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +InterruptIn event(USER_BUTTON); + +Serial ser(USBTX, USBRX); + +bool pressed = false; + +void KeyPressed() +{ + ser.printf("Key Pressed\r\n"); + pressed = true; +} + +int main() { + ser.baud(230400); + ser.printf("Hello, World\r\n"); + event.fall(&KeyPressed); + + while(1) { + myled = 1; + wait(0.2); + myled = 0; + wait(1.0); + if (pressed) { + deepsleep(); + pressed = false; + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 22 13:05:35 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file