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
- Date:
- 2017-05-10
- Revision:
- 7:1d77c7e0208c
- Parent:
- 1:76cff32344d1
- Child:
- 8:aff4290aacff
File content as of revision 7:1d77c7e0208c:
// // Created by Kristof on 5/9/2017. // #include "Controller.h" void Controller::runThread(){ lightCommunication->receiveData(); } Controller::Controller() { //constructor once to initialise lightCommunication = new LightCommunication(); car = new m3pi(); receiveThread.start(Controller::runThread); 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; }