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 6:d5864a1b9e17, committed 2014-11-18
- Comitter:
- manumaet
- Date:
- Tue Nov 18 13:39:50 2014 +0000
- Parent:
- 5:111f11c95d27
- Child:
- 7:e634eeafc4d2
- Commit message:
- button interrupt tester
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 18 13:35:48 2014 +0000
+++ b/main.cpp Tue Nov 18 13:39:50 2014 +0000
@@ -12,6 +12,10 @@
//#define SENDER
+void Interrupthandler() {
+ pc.printf("Interrupt!!!!!!!!!!!!!!!!!!!!!!!!\r\n");
+}
+
int main() {
int i=0;
pc.printf("DecaWave 0.1\r\nup and running!\r\n");
@@ -31,11 +35,8 @@
#ifndef SENDR
uint8_t dataframereadyinterrupt = 0x20; // only good frame would be 0x40
dw.writeRegister(DW1000_SYS_MASK, 1, &dataframereadyinterrupt, 1);
- DigitalIn button(USER_BUTTON);
- while(1) {
- pc.printf("Status: %X\r\n", (int)button);
- wait(0.1);
- }
+ InterruptIn button(USER_BUTTON);
+ button.rise(&Interrupthandler);
#endif
while(1) {