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.
Dependencies: RemoteIR m3pi mbed-rtos mbed
Controller.cpp
- Committer:
- Kristof@LAPTOP-FT09DA9V.home
- Date:
- 2017-05-09
- Revision:
- 1:76cff32344d1
- Child:
- 7:1d77c7e0208c
File content as of revision 1:76cff32344d1:
// // Created by Kristof on 5/9/2017. // #include "Controller.h" Controller::Controller() { //constructor once to initialise static LightCommunication lightCommunication; car = new m3pi(); receiveThread.start(&LightCommunication::receiveData); ir_rx = new ReceiverIR(p21); } Controller::~Controller() { } int Controller::run() { LightCommunication::mut.lock(); if (LightCommunication::needsToStop()){ car->stop(); LightCommunication::mut.unlock(); }else { current_left = LightCommunication::getLeft(current_left); current_right = LightCommunication::getRight(current_right); LightCommunication::mut.unlock(); car->left_motor(current_left) ; car->right_motor(current_right) ; } return 0; }