K K / Mbed 2 deprecated Movement_code

Dependencies:   MODSERIAL QEI mbed

Revision:
5:a1376ab695f3
Parent:
4:60bc2ee4d838
Child:
6:206fff3b20b0
--- a/main.cpp	Wed Oct 07 17:46:01 2015 +0000
+++ b/main.cpp	Wed Oct 07 18:33:16 2015 +0000
@@ -14,7 +14,7 @@
 
 int main()
 {
-   float cycle = 0.6;//define the speed of the motor
+   float cycle = 0.6f;//define the speed of the motor
    bool motor1_on = 1;
    int motor1_dir=0;
    
@@ -28,8 +28,8 @@
    while(button1.read() != motor1_on){// turn on motor 1 when the button is being pressed
        led3.write(1);
        led1.write(0);
-       
-       direction1.write(motor1_dir);//turn motor CCW or CW if set to 0
+       pc.printf("%f", speed1.read());
+       direction1.write(motor1_dir);//turn motor CCW or CW
    //motor CW = 0
    //motor CCW = 1
        speed1.period_us(100);//Set period of PWM to 100 us.