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.
Revision 0:bc5a282e8a84, committed 2019-09-14
- Comitter:
- Tomo1213
- Date:
- Sat Sep 14 11:23:34 2019 +0000
- Commit message:
- first commit;
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 Sat Sep 14 11:23:34 2019 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+PwmOut m(PA_9);
+Serial pc(USBTX,USBRX);
+
+#if 1
+int main(){
+ m.period_ms(20);
+ int pw=1500;
+ while(1){
+
+ char input = pc.getc();
+ if(input == 'w'){
+ pw+=50;
+ }else if(input == 's'){
+ pw-=50;
+ }
+ printf("%d\r\n",pw);
+
+ m.pulsewidth_us(pw);
+
+ }
+}
+#endif
+
+#if 0
+int main(){
+ m.period_ms(20);
+
+ while(1){
+ m.pulsewidth_us(400);
+ wait(1.5);
+ m.pulsewidth_us(2550);
+ wait(1.5);
+ }
+}
+#endif
+
+#if 0
+int main(){
+ m.period_ms(20);
+
+ while(1){
+ m.pulsewidth_us(1000);
+ wait(1.5);
+ m.pulsewidth_us(2000);
+ wait(1.5);
+ }
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Sep 14 11:23:34 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file