Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of hudo by
main.cpp
00001 #include "mbed.h" 00002 00003 #define SERVODEG 0.0 00004 #define MaxDeg 25.0 00005 00006 PwmOut servo(p21); 00007 AnalogIn input(p20); 00008 double bairitu; 00009 00010 double calcPulse(int deg){ 00011 return (0.0006+(deg/180.0)*(0.00235-0.00045)); 00012 } 00013 00014 int main() { 00015 while(1){ 00016 bairitu = (input-0.5)*2; 00017 servo.pulsewidth(calcPulse(71.0 + SERVODEG + bairitu*MaxDeg));//calcPulse = 90の時がニュートラル 00018 wait(0.1); 00019 } 00020 }
Generated on Sun Aug 21 2022 08:31:47 by
1.7.2
