Toggles an LED whenever a digital joystick input goes high

Dependencies:   mbed

Revision:
0:188b8ea8f365
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 17 11:46:41 2015 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+InterruptIn joystick_Reset(p14); // Configure InterruptIn object with p14, which corresponds to joystick reset function
+DigitalOut myLED(LED4); // Has to be LED1-4, not a pin
+
+void toggle(void);
+
+int main()
+{
+    joystick_Reset.rise(&toggle); // Attach the address of the toggle to the rising edge
+}
+
+void toggle()
+{
+    myLED=!myLED;
+}
\ No newline at end of file