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: main.cpp
- Revision:
- 0:a7d68fd605f6
- Child:
- 1:ffa16c2a347f
diff -r 000000000000 -r a7d68fd605f6 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Oct 23 09:47:14 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "DigitalSw.h"
+
+DigitalSw sw(p21);
+
+DigitalOut level(LED4);
+DigitalOut onEdgeToggle(LED1);
+DigitalOut offEdgeToggle(LED2);
+
+int main() {
+ while(1) {
+
+ level = sw.getLevel();
+
+ if(sw.getOnEdge() == 1){
+ onEdgeToggle = !onEdgeToggle;
+ }
+
+ if(sw.getOffEdge() == 1){
+ offEdgeToggle = !offEdgeToggle;
+ }
+
+ }
+
+}