K K / Mbed 2 deprecated Motor_control_exercise

Dependencies:   Encoder MODSERIAL mbed

Revision:
2:6ed3b386d4fa
Parent:
1:0f99afbd578a
Child:
3:8583035f898b
--- a/main.cpp	Wed Sep 23 07:39:40 2015 +0000
+++ b/main.cpp	Wed Sep 23 07:46:49 2015 +0000
@@ -3,8 +3,8 @@
 #include "MODSERIAL.h"
 
 DigitalOut led(LED_RED);
-DigitalOut motor1(D4);
-PWMOut speed1(D5);
+DigitalOut direction1(D4);
+PwmOut speed1(D5);
 DigitalIn button(PTC6);
 
 Encoder motor1(D13,D12,true);
@@ -17,8 +17,8 @@
    //motor CW = 0
    //motor CCW = 1
    while(PTC6==0){//as long as button is pressed turn on motor
-       motor1(1);//turn motor CW
-       speed1(1);//Set speed of motor to full.
+       direction1=1;//turn motor CW
+       speed1=1;//Set speed of motor to full.
        }
        
    while(1) {