blob: ef8772da18e03ee98ed3824c948d7d3606f3dcc7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "test_env.h"
#if defined(TARGET_LPC4088)
InterruptIn wkp(P2_10);
#elif defined(TARGET_K22F)
InterruptIn wkp(D0);
#elif defined(TARGET_LPC11U68)
InterruptIn wkp(P0_16);
#else
InterruptIn wkp(p14);
#endif
void flip() {
printf("button pressed\n");
}
int main() {
#if defined(TARGET_LPC11U68)
wkp.mode(PullUp);
#endif
wkp.rise(&flip);
while (true) {
// sleep();
deepsleep();
}
}
|