Bereček nedovršeno

Dependencies:   mbed

main.cpp

Committer:
Beromunja
Date:
2016-11-03
Revision:
0:d106c69c164d

File content as of revision 0:d106c69c164d:

#include "mbed.h"
AnalogIn Ain(p20);
DigitalOut myled(LED1);
DigitalOut myled1(LED2);
DigitalOut myled2(LED3);
DigitalOut myled3(LED4);
float a;

int main() {
    
while(1) {
    a=ain:
   IF(a<0.2);
LED1 = 0;
LED2 = 0;
LED3 = 0;
LED4 = 0;

}
if {
Ain<= 0.4;
LED1 = 1;
LED2 = 0;
LED3 = 0;
LED4 = 0;
}
 if{
Ain=0.6;
LED1 = 1;
LED2 = 1;
LED3 = 0;
LED4 = 0;
}
if {
Ain<=0.8;
LED1 = 1;
LED2 = 1;
LED3 = 1;
LED4 = 0;
}
if {
Ain <= 1;
LED1 = 1;
LED2 = 1;
LED3 = 1;
LED4 = 1;
}
}