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
Revision 6:9e04367c30f0, committed 2017-09-05
- Comitter:
- Banyrud
- Date:
- Tue Sep 05 12:27:09 2017 +0000
- Parent:
- 5:f9408b526333
- Commit message:
- BAN og AM - 05/09/17
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
+ }
+ }
+ }
}
}
-
+