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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 6:9e04367c30f0
- Parent:
- 5:f9408b526333
diff -r f9408b526333 -r 9e04367c30f0 main.cpp
--- a/main.cpp	Tue Aug 29 12:02:42 2017 +0000
+++ b/main.cpp	Tue Sep 05 12:27:09 2017 +0000
@@ -1,16 +1,37 @@
 #include "mbed.h"
 
-BusOut myleds(p21, p22, p23, p24);
-unsigned char teller = 0;
+BusOut myleds(p21, p22, p23, p24, p25, p26);
+DigitalIn bryter20 (p20);
+DigitalIn bryter19 (p19);
+int teller = 0;
+Serial pc (USBTX, USBRX);
+
+
 
-int main() {
-        while(1) {
-        for(int i=0; i<16; i++) {
-            myleds = i;
-            wait(0.25);
-    }
+int main()
+{
+    while(1) {
+        if (bryter20 == 1) {
+            for(teller=0; teller<=30; teller++) {
+                pc.printf ("%d\n", teller);
+                myleds = teller;
+                wait(0.25);
+                if (bryter19 == 1) {
+                    teller = 0;
+                }
+            }
+        } else {
+            for(teller=0; teller<=50; teller++) {
+                pc.printf ("%d\n", teller);
+                myleds = teller;
+                wait(0.25);
+                if (bryter19 == 1) {
+                    teller = 0;
+                }
+            }
+        }
     }
 }
 
-        
 
+