サーボをパルスで制御しています。バグ、質問等は中田までよろしく。

Dependencies:   mbed

Fork of BusOut_HelloWorld by mbed_example

Committer:
WAT34
Date:
Thu Dec 18 06:56:54 2014 +0000
Revision:
2:e6fae83a99c1
Parent:
0:717993c337df
www

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:717993c337df 1 #include "mbed.h"
WAT34 2:e6fae83a99c1 2 PwmOut ser(p21);
WAT34 2:e6fae83a99c1 3
WAT34 2:e6fae83a99c1 4 int main(){
WAT34 2:e6fae83a99c1 5 ser.period_ms(17);
WAT34 2:e6fae83a99c1 6 ser.pulsewidth_ms(2.3);
WAT34 2:e6fae83a99c1 7 wait(1);
WAT34 2:e6fae83a99c1 8 while(1){
WAT34 2:e6fae83a99c1 9 ser.pulsewidth_ms(1.5);
WAT34 2:e6fae83a99c1 10 wait(1);
WAT34 2:e6fae83a99c1 11 ser.pulsewidth_ms(2.3);
WAT34 2:e6fae83a99c1 12 wait(1);
mbed_official 0:717993c337df 13 }
WAT34 2:e6fae83a99c1 14 }
WAT34 2:e6fae83a99c1 15