Jia Jun Ong
/
SectionB-1OngJiaJun
Updated
Diff: main.cpp
- Revision:
- 4:6e4d8744e5fb
- Parent:
- 3:a1439fe436e9
--- a/main.cpp Wed Jan 30 03:02:47 2019 +0000 +++ b/main.cpp Fri Feb 15 06:26:41 2019 +0000 @@ -13,15 +13,86 @@ // Set up button1.mode(PullUp); button1.fall(&BUTTON_ISR); - + while (1){ + if (button1 == 0){ + myled = 1; // LED is ON + wait(0.2); // 200 ms + myled = 0; // LED is OFF + wait(0.2); // 200 ms + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + }else if (button1 == 0){ + myled = 1; // LED is ON + wait(0.2); // 200 ms + myled = 0; // LED is OFF + wait(0.2); // 200 ms + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + }else { + myled = 0;} + } + __wfi(); //Wait for interruptions - myled = 1; // LED is ON - wait(0.2); // 200 ms - - <<<<<<<<<YOUR CODE SHOULD BE HEREE>>>> - - __wfi(); //Wait for interruptions - } \ No newline at end of file