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.
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); // tx, rx 00004 PwmOut esc(p22); 00005 00006 int main() { 00007 00008 int key_in = 0; 00009 double pulse_buf2 = 0; 00010 double pulse = 0; 00011 00012 esc.period(0.018); 00013 esc.pulsewidth(0.001); 00014 00015 while (1) { 00016 00017 // ASCII henkan omazinai 00018 key_in = pc.getc()-48; 00019 //pc.printf("%d",key_in); 00020 00021 //if(){ 00022 //pulse_buf ni value wo input 00023 //} 00024 00025 // pulse no tasizan 0.001 ~ 0.002 00026 //pulse = 0.001+0.0001*(double)pulse_buf; 00027 00028 // limmiter 00029 if( pulse<0.001 ){ pulse = 0.001; } 00030 if( 0.0019<pulse ){ pulse = 0.0019; } 00031 00032 // updating pulse width 00033 esc.pulsewidth(pulse); 00034 00035 pc.printf("%f\r\n", pulse); 00036 00037 } 00038 00039 }
Generated on Thu Jul 21 2022 12:41:03 by
1.7.2