PWM + RGB code example for FRDM-KL25Z

Dependencies:   mbed

main.cpp

Committer:
APanecatl
Date:
2014-06-04
Revision:
0:cb11ef198767

File content as of revision 0:cb11ef198767:

#include "mbed.h"

PwmOut Red(LED_RED);
//PwmOut Green(LED_GREEN);



int main() 
{
    Red.period_ms(2000);
 //   Green.period(1000);
  //  Red.pulsewidth_ms(500);
    int x;
    x=1;
    
    while(1)
    {
        Red.pulsewidth_ms(x);
        x=x+2;
        wait(1);
        if(x==1000)
        {
            x=1;
        }
    }
        
}