Polybot Grenoble / Mbed 2 deprecated CDF2019

Dependencies:   mbed

Committer:
CharlesBl
Date:
Thu Nov 08 10:08:51 2018 +0000
Revision:
1:b667efac1cae
Parent:
0:d0a183ba50d5
Child:
2:f0cd1961cbe3
test de pull;

Who changed what in which revision?

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