Part of FRAB program at FIBO, KMUTT

Dependencies:   mbed

Committer:
choyai
Date:
Thu Mar 21 12:44:39 2019 +0000
Revision:
0:090c08c4dc2a
initial

Who changed what in which revision?

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