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.
Fork of DC_motor_1 by
Revision 1:36da0aeaa51f, committed 2017-12-18
- Comitter:
- dfraj
- Date:
- Mon Dec 18 10:52:02 2017 +0000
- Parent:
- 0:1047df2357c5
- Commit message:
- v2: added second PwmOut object
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Dec 18 10:32:36 2017 +0000
+++ b/main.cpp Mon Dec 18 10:52:02 2017 +0000
@@ -1,13 +1,15 @@
#include "mbed.h"
-PwmOut motor(p21);
+PwmOut smjer1(p21);
+PwmOut smjer2(p22);
PwmOut ledica(LED1);
AnalogIn pot(p20);
int main(){
- motor.period(0.001);
+ smjer1.period(0.001);
+ smjer2 = 0;
while(true){
- motor = pot;
+ smjer1 = pot;
ledica = pot;
}
}
\ No newline at end of file
