#include “mbed.h”
#include “C12832.h”
InterruptIn joystickcenter(p14);
InterruptIn button(p9);
DigitalOut led(LED1);
DigitalOut flash(LED4);
int x;
void flip(int x=1) {
led = !led; // toggles the led when the joystick button is pressed.
}
int main() {
joystickcenter.rise(&flip); // attach the function address to the rising edge
button.mode(PullUp); // With this, no external pullup resistor needed
button.rise(&flip); // attach the function address to the rising edge
while(1) { // wait around, interrupts will interrupt this!
if(x==1){
lcd.locate(0.0);
lcd.printf(“Varialble SET!”);
flash = !flash; // turns LED4 on if off, off if on
wait(0.25); // the instruction to wait for a quarter-second
}
}
}
Getting an error on joystickcenter.rise(&flip); // attach the function address to the rising edge.
Its basic I know but just starting out, so would be grateful for any help. Thanks