Promjenaq frekvencije ovisno o položaju prekidača

Dependencies:   mbed

main.cpp

Committer:
vgregl
Date:
2015-05-08
Revision:
0:745a43b3e717

File content as of revision 0:745a43b3e717:

#include "mbed.h"
 DigitalIn sw(p5);
 DigitalOut greenled (p6);
 int main() {
     sw.mode(PullUp);
while(1) {
    if (sw==0){
        greenled= 1;
        wait (5);
        greenled = 0;
        wait(5);
        }
    else if (sw==1) {
        greenled= 0;
        wait (0.2);
        greenled = 1;
        wait(0.2);
        }
        }
        }