Christ Scheldeman / Mbed 2 deprecated Nucleo_pwm

Dependencies:   mbed

Committer:
CSCLOG
Date:
Wed Aug 20 18:48:42 2014 +0000
Revision:
0:ac0af9ce85ae
Test

Who changed what in which revision?

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