Nicolae Marton / Mbed 2 deprecated TDP3_OOP

Dependencies:   mbed

LineFollowingRobot/main.cpp

Committer:
Nicolaemf
Date:
2019-02-02
Revision:
1:a2ceed49374e
Parent:
0:a02a278513d9
Child:
2:74d8b693bc62

File content as of revision 1:a2ceed49374e:

#include <mbed.h>
#include "RobotControl_H.h"
#include "IRSensor_H.h"


Ticker sampling;



int main(){

bool toggleIR;

IRSensor IRSensor(PTC6, PTC5, PTC4, PTC3, PTC0, 0.0, 0.0, 0.0);

sampling.attach(callback(&IRSensor, &IRSensor::Sample), 0.01);

RobotControl controlLeft(PTC12,PTD4,PTA5);
RobotControl controlRight(PTA13,PTA12,PTA4);


 
 while(1){

    
    if(toggleIR != IRSensor.m_toggle){
        IRSensor.WeightPID();
        IRSensor.CalculatePID();
        IRSensor.MotorControl(controlLeft,controlRight);
        }
        
    }   
    
}