tried

Dependencies:   mbed

Fork of adam_try by CHE-HAO CHUANG

Committer:
adam_z
Date:
Tue Jan 12 14:00:38 2016 +0000
Revision:
1:d6e970ba1de1
Parent:
0:0583c47b5640
already tried

Who changed what in which revision?

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