interesting

Dependencies:   C12832_lcd mbed

Fork of Bootcamp-Interrupt_Polling_Joystick by avnish aggarwal

main.cpp

Committer:
avnisha
Date:
2013-04-23
Revision:
1:102ef7d39407
Parent:
0:0e4db18afd77
Child:
2:d18857b99d3c

File content as of revision 1:102ef7d39407:


#include "mbed.h"

InterruptIn fire(p14);
DigitalOut  led(LED1);
DigitalOut  flash(LED4);

void ISR1() {
    led = !led;
}

int main()
{
    fire.rise(&ISR1);
    fire.fall(&ISR1);
    
    while (1) {
        flash = !flash;
        wait(0.25);
    }   
}

#ifdef OLD
#include "mbed.h"

BusIn joy(p15,p12,p13,p16);
InterruptIn fire(p14);

BusOut leds(LED1,LED2,LED3,LED4);

int main()
{
    while(1) {
        if (fire) {
            leds=0xf;
        } else {
            leds=joy;
        }
        wait(0.1);
    }
}
#endif