Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Blinking2Ledswith_SwitchButton.cpp
- 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);
+ }
+}