Exercise of motor control

Dependencies:   Encoder MODSERIAL mbed

Revision:
3:8583035f898b
Parent:
2:6ed3b386d4fa
Child:
4:646f8d3f0643
--- a/main.cpp	Wed Sep 23 07:46:49 2015 +0000
+++ b/main.cpp	Wed Sep 23 08:04:16 2015 +0000
@@ -7,7 +7,7 @@
 PwmOut speed1(D5);
 DigitalIn button(PTC6);
 
-Encoder motor1(D13,D12,true);
+Encoder motor1(D13,D12,true);// call the encoder
 MODSERIAL pc(USBTX,USBRX);
 
 int main()
@@ -18,7 +18,7 @@
    //motor CCW = 1
    while(PTC6==0){//as long as button is pressed turn on motor
        direction1=1;//turn motor CW
-       speed1=1;//Set speed of motor to full.
+       speed1=0.1;//Set speed of motor to full.
        }
        
    while(1) {