LedFunc

Dependencies:   mbed

https://os.mbed.com/teams/ABELI2019/code/Robin-Handy/

Revision:
0:5fab0572b588
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 06 19:36:00 2019 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+
+void allLedsOn();
+void allLedsOff();
+void changeLed1();
+
+
+
+int main() {
+    while (1) {
+
+    allLedsOn();
+    wait_ms(500);
+    changeLed1();
+    wait_ms(500);
+    allLedsOff();
+    wait_ms(500);
+        
+    }
+}
+void allLedsOn()
+{
+    led1 = 1;
+    led2 = 1;
+    led3 = 1;
+    led4 = 1;
+}
+void allLedsOff()
+{
+    led1 = 0;
+    led2 = 0;
+    led3 = 0;
+    led4 = 0;
+    
+}
+void changeLed1()
+{
+    if(led1==1)
+    {
+        led1=0;
+    }
+}
+
+
+