File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
libraries/tests/mbed/interruptin_2 Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,21 @@ InterruptIn button8(p10);
13
13
InterruptIn button9 (p9);
14
14
DigitalOut led (LED1);
15
15
DigitalOut flash (LED4);
16
+
17
+ #elif defined(TARGET_LPC1114)
18
+ InterruptIn button (p30); // SW2 (User switch)
19
+ InterruptIn button1 (p5);
20
+ InterruptIn button2 (p6);
21
+ InterruptIn button3 (p7);
22
+ InterruptIn button4 (p9);
23
+ InterruptIn button5 (p10);
24
+ InterruptIn button6 (p12);
25
+ InterruptIn button7 (p13);
26
+ InterruptIn button8 (p14);
27
+ InterruptIn button9 (p15);
28
+ DigitalOut led (LED1);
29
+ DigitalOut flash (LED2);
30
+
16
31
#else
17
32
InterruptIn button (p30);
18
33
InterruptIn button1 (p29);
@@ -33,6 +48,11 @@ void flip() {
33
48
}
34
49
35
50
int main () {
51
+ flash = 0 ;
52
+ led = 0 ;
53
+ #if defined(TARGET_LPC1114)
54
+ button.mode (PullUp);
55
+ #endif
36
56
button.rise (&flip); // attach the address of the flip function to the rising edge
37
57
button1.rise (&flip);
38
58
button2.rise (&flip);
@@ -43,6 +63,7 @@ int main() {
43
63
button7.rise (&flip);
44
64
button8.rise (&flip);
45
65
button9.rise (&flip);
66
+
46
67
while (1 ) { // wait around, interrupts will interrupt this!
47
68
flash = !flash;
48
69
wait (0.25 );
You can’t perform that action at this time.
0 commit comments