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
Revision 2:8b2466c9dce3, committed 2017-04-21
- Comitter:
- jcm931213
- Date:
- Fri Apr 21 01:02:48 2017 +0000
- Parent:
- 1:6de41d7e14b5
- Child:
- 3:6102eed27fab
- Commit message:
- update
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Apr 20 02:17:28 2017 +0000
+++ b/main.cpp Fri Apr 21 01:02:48 2017 +0000
@@ -1,19 +1,19 @@
#include "mbed.h"
-
-
+
PwmOut pwm0(D3);
PwmOut pwm1(D5);
-
-
+
int main(void)
{
int i;
-
while(1){
- for(i=1000; i>0; i=i-1) {
+ for(i=0; i<1000; i=i+1) {
+
pwm0.write(i*0.001);
- pwm1.pulsewidth_us(i*100);
- wait(0.005);
+
+ pwm1.pulsewidth_us(i*20);
+
+ wait(0.01);
}
}
}