David Mc Sherry
/
EMBED_LAB_Q1
Question 1 for Embed Lab
Diff: main.cpp
- Revision:
- 0:0cbd2a7185e7
- Child:
- 1:780300dcee8d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Aug 16 16:47:23 2021 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" + +InterruptIn up (p15); +InterruptIn down (p12); +InterruptIn left (p13); +InterruptIn right (p16); +InterruptIn center (p14); + +void Up (){ + + printf("Up\r\n"); + + } + +void Down (){ + + printf("Down\r\n"); + + } + +void Left (){ + + printf("Left\r\n"); + + } + +void Right (){ + + printf("Right\r\n"); + + } + +void Center (){ + + printf("Center\r\n"); + + } + +int main() { + + up.rise (&Up); + down.rise (&Down); + left.rise (&Left); + right.rise (&Right); + center.rise (&Center); + } +