Light shahne jaise bright hotai aaram se, fir dim hotai aur wapas bright hotai aur wapas dim aise hote rehtai

Dependencies:   mbed

main.cpp

Committer:
akashlal
Date:
2016-06-28
Revision:
0:65e721f9f9ab

File content as of revision 0:65e721f9f9ab:

#include "mbed.h"

PwmOut led(PTB18);
float i=0;

int main() 
{
    led.period_ms(30);
    while(1) 
    {
        for(i=1;i>0;i=i-0.1)
        {
            led=i;
            wait(0.2);
        }
        for(i=0;i<1;i=i+0.1)
        {
            led=i;
            wait(0.2);
        }
       
    }
}