Sølibatgutt / Mbed 2 deprecated Oving315

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 Serial pc(USBTX, USBRX);
00003 BusOut teller(p21, p22, p23, p24, p25, p26);
00004 DigitalOut bryter(p20);
00005 DigitalOut bryter2(p19);
00006 
00007 
00008 int main()
00009 {
00010     while(1) {
00011         float a = 0.1;
00012         if (bryter2 == 1) {
00013             a = 1;
00014             }
00015         if (bryter == 0) {
00016             for(int x = 0; x <= 15; x++) {
00017                 teller = x;
00018                 wait(a);
00019                 if (x == 15) {
00020                     for(int x = 15; x > 0; x--) {
00021                         teller = x;
00022                         wait(a);
00023                     }
00024                 }
00025             }
00026         }
00027         if (bryter == 1) {
00028             for(int x = 0; x <= 63; x++) {
00029                 teller = x;
00030                 wait(a);
00031                 if (x == 63) {
00032                     for(int x = 63; x > 0; x--) {
00033                         teller = x;
00034                         wait(a);
00035                     }
00036                 }
00037             }
00038         }
00039     }
00040 }