ELCT302 Motor / Mbed 2 deprecated motor

Dependencies:   mbed MotorLab3Code

Revision:
1:5b2bc7ec7b14
Parent:
0:cb571e42343c
Child:
2:060a86df835f
--- a/main.cpp	Wed Jan 30 21:05:23 2019 +0000
+++ b/main.cpp	Thu Jan 31 00:39:41 2019 +0000
@@ -1,22 +1,16 @@
 #include "mbed.h"
 #include <iostream>
-Serial pc(USBTX, USBRX);
 
 AnalogIn AI_in(PTB0);
 PwmOut PWM_out(PTE20);
 
-float SP;
-float DC;
+
+
 
 int main() {
     PWM_out.period(.05);
-    
     while(1) {
-        SP=AI_in;
-        DC=SP / 3.3;
-        PWM_out=DC * 100;
-        cout <<PWM_out.read() << endl;
-        
-        
+      PWM_out.write(AI_in.read());
+        wait(.05);        
     }
 }