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: SwitchONledBlinkss5secs.cpp
- Revision:
- 2:48d0e4493777
diff -r 09943c9a9c06 -r 48d0e4493777 SwitchONledBlinkss5secs.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SwitchONledBlinkss5secs.cpp Tue Jun 01 13:44:16 2021 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+DigitalOut yellowled(p5);
+DigitalIn switchbutton(p10);
+
+int i=0;
+ void Blink(){
+ while(i<5){
+ yellowled=0;
+ wait(0.5);
+ yellowled=1;
+ wait(0.5);
+ i++;
+ }
+ yellowled=0;
+}
+ int main(){
+ while (1){
+ if(switchbutton==1)
+ {
+ Blink();
+ }
+ i=0;
+ wait(0.5);
+ }
+ }