Nicolae Marton / Mbed 2 deprecated TDP3_MovementControl

Dependencies:   mbed

main.cpp

Committer:
Nicolaemf
Date:
2018-10-31
Revision:
11:5e955cf303ab
Parent:
6:b476699ac7d4

File content as of revision 11:5e955cf303ab:

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx

PwmOut myled(LED1);
PwmOut motorRight(PTD0);
PwmOut motorLeft(PTD5);

//PwmOut pwm1(PTD0);
AnalogIn potInput(PTB0);
float storeInput;


int main() {
    
    myled = 0.1;
    
    while(1) {
        
        myled = myled + 0.1;
        
        if(myled >= 1){
            myled = 0;
            }
    storeInput = potInput.read();
    motorRight = storeInput;
    motorLeft = (storeInput * -1.0) + 1.0;
        
    pc.printf("%f\n", storeInput);
        
    wait(0.1);
        
   }
    
}