CRAC-LIB

Dependents:   Asserv_mot Asserv_mot

MYCRAC_utility.cpp

Committer:
Brand101
Date:
2017-04-19
Revision:
0:cbe368f18aeb

File content as of revision 0:cbe368f18aeb:

#include "mbed.h"
#include "MYCRAC_utility.h"

void write_PWM1(double vit)
{

    if(vit < 0.0)                    
    { 
        vit = -vit;
        INA_M1 = 1;
        INB_M1 = 0;    
    }
    else                            
    {
        INA_M1 = 0;
        INB_M1 = 1;
    }
     
    mot1.write(vit);
    test1++;
}

void write_PWM2(double vit)
{
    
    if(vit < 0.0)                    
    {

        vit = -vit;
        INA_M2 = 1;
        INB_M2 = 0;
         
    }
    else                            
    { 
        INA_M2 = 0;
        INB_M2 = 1; 
    }
    
    mot2.write(vit);
    test2++;
}