Gabriel Karerangabo / Mbed 2 deprecated Blink_SwitchButton

Dependencies:   mbed

Revision:
0:f792b1ecc7b3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Blinking2Ledswith_SwitchButton.cpp	Fri Jun 04 16:17:38 2021 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+DigitalOut redLed(p5);
+DigitalOut yellowLed(p7);
+DigitalIn switchButton(p6);
+
+int main() {
+  
+    while (1) {
+        if(switchButton==1){
+            redLed=1;
+            yellowLed=0;
+        }
+        else{
+            redLed=0;
+            yellowLed=1;
+        }
+        
+        wait(1);
+    }
+}