tim010 tim010 / Mbed 2 deprecated LV5_PAI_Grupa6_Tim010_Zadatak3

Dependencies:   mbed

Committer:
tim010
Date:
Thu Apr 03 15:45:34 2014 +0000
Revision:
0:c858fcbd0f70
LV5 - PAI - Grupa 6 - Tim010

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tim010 0:c858fcbd0f70 1 #include "mbed.h"
tim010 0:c858fcbd0f70 2 AnalogIn x(dp9);
tim010 0:c858fcbd0f70 3 PwmOut y(dp24);
tim010 0:c858fcbd0f70 4 BusOut ledice(dp23, dp25, dp26, dp27, dp5, dp6, dp28);
tim010 0:c858fcbd0f70 5 DigitalOut enable(dp14);
tim010 0:c858fcbd0f70 6
tim010 0:c858fcbd0f70 7 int main()
tim010 0:c858fcbd0f70 8 {
tim010 0:c858fcbd0f70 9 enable=0;
tim010 0:c858fcbd0f70 10 ledice=0;
tim010 0:c858fcbd0f70 11 wait_ms(50);
tim010 0:c858fcbd0f70 12 y.period_us(50);
tim010 0:c858fcbd0f70 13 float x1(0.8/3.3);
tim010 0:c858fcbd0f70 14 float z(x);
tim010 0:c858fcbd0f70 15 while(1)
tim010 0:c858fcbd0f70 16 {
tim010 0:c858fcbd0f70 17
tim010 0:c858fcbd0f70 18 if(x<x1) z=0;
tim010 0:c858fcbd0f70 19 else z=x;
tim010 0:c858fcbd0f70 20 y = z;
tim010 0:c858fcbd0f70 21 }
tim010 0:c858fcbd0f70 22
tim010 0:c858fcbd0f70 23 }