Program for controlling speed of motor

Dependencies:   mbed

Fork of DC_motor_1 by Dean Fraj

Files at this revision

API Documentation at this revision

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
diff -r 1047df2357c5 -r 36da0aeaa51f main.cpp
--- 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