![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Complete
Diff: main.cpp
- Revision:
- 2:029b0a855b82
- Parent:
- 1:c5bc18044085
- Child:
- 3:ecfa4fa0b5a7
--- a/main.cpp Sat Jan 30 02:29:20 2016 +0000 +++ b/main.cpp Sat Jan 30 02:34:55 2016 +0000 @@ -8,6 +8,7 @@ #include "mbed.h" #include "wdt.h" #include "MCP23S17.h" +#include "Nav_Switch.h" @@ -35,7 +36,7 @@ { _pins.mode(PullUp); - + Nav_Switch myNav( p18, p15, p16, p19, p17); char Opcode = 0x40; @@ -56,9 +57,9 @@ switch3.mode(PullUp); switch4.mode(PullUp); - // Delay for initial pullup to take effect - wait(.25); - // Setup Interrupt callback functions for a pb hit + + wait(.45); + while(1){ @@ -91,12 +92,13 @@ break; case 0x5: - + mbedleds = ~(myNav & 0x0F); //update leds with nav switch direction inputs + if(myNav.fire()) mbedleds = 0x0F; break; } - + wait(0.05); } }