Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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);
}
}
}