Zadatak 3-4

Dependencies:   mbed

main.cpp

Committer:
Kzupancic
Date:
2015-12-10
Revision:
0:8748fc4ae628

File content as of revision 0:8748fc4ae628:

#include "mbed.h"
 
int main() {
DigitalOut led1(LED1);
DigitalIn inputsw(p7);
inputsw.mode(PullUp); 
    float tx=0.5;
    float ty=0.5;
    
    while(1){
    led1=0;
    wait(tx);
    led1=1;
    wait(tx);
    if(inputsw==1){
        tx=ty/2.0;
        }
        else if (inputsw==0)
        {
            tx=ty*2;
            }
    }
}