RGB LED whitch using PWM signal for the CORE-1000

Dependencies:   mbed

Committer:
bcostm
Date:
Wed Feb 12 15:34:26 2014 +0000
Revision:
0:4860a91fb495
Child:
2:b7f2b24f6dac
Initial version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:4860a91fb495 1 #include "mbed.h"
bcostm 0:4860a91fb495 2
bcostm 0:4860a91fb495 3 PwmOut mypwm(PWM_OUT);
bcostm 0:4860a91fb495 4
bcostm 0:4860a91fb495 5 DigitalOut myled(LED1);
bcostm 0:4860a91fb495 6
bcostm 0:4860a91fb495 7 int main() {
bcostm 0:4860a91fb495 8
bcostm 0:4860a91fb495 9 mypwm.period_ms(10);
bcostm 0:4860a91fb495 10 mypwm.pulsewidth_ms(1);
bcostm 0:4860a91fb495 11
bcostm 0:4860a91fb495 12 printf("pwm set to %.2f %%\n", mypwm.read() * 100);
bcostm 0:4860a91fb495 13
bcostm 0:4860a91fb495 14 while(1) {
bcostm 0:4860a91fb495 15 myled = !myled;
bcostm 0:4860a91fb495 16 wait(1);
bcostm 0:4860a91fb495 17 }
bcostm 0:4860a91fb495 18 }