Tobi's ubw test branch
Dependencies: mavlink_bridge mbed
Fork of AIT_UWB_Range by
Diff: main.cpp
- Revision:
- 6:d5864a1b9e17
- Parent:
- 5:111f11c95d27
- Child:
- 7:e634eeafc4d2
diff -r 111f11c95d27 -r d5864a1b9e17 main.cpp --- 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) {