Nagito Sukegawa
/
Test_Brushless_Driver
2020 Off season development Test of brushless motor driver
Revision 0:710164f391d3, committed 2020-03-12
- Comitter:
- st17099ng
- Date:
- Thu Mar 12 15:20:04 2020 +0000
- Commit message:
- Initial version
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 12 15:20:04 2020 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" + +DigitalOut myled(LED1);//LED1,p26 +PwmOut led1(D7); +//Serial pc(D8,D2,115200); +Serial pc(USBTX,USBRX,115200); + +int main() +{ + led1.period_ms(20); + led1.pulsewidth_us(2000); + wait_ms(1); + led1.pulsewidth_us(1000); + wait_ms(1); + myled = 1; + wait(3); + while(1) { + myled=0; + for(int i = 1000; i < 2000; i+=10) { + led1.pulsewidth_us(i); + wait_ms(30); + } + for(int i = 2000; i > 1000; i-=10) { + led1.pulsewidth_us(i); + wait_ms(30); + } +// NVIC_SystemReset(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 12 15:20:04 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file