![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
mit pathdingsbums
Dependencies: mbed
Fork of MicroMouse_MASTER_TWO by
CheckWalls.cpp
- Committer:
- ruesipat
- Date:
- 2018-04-25
- Revision:
- 5:b8b1a979b0d5
- Parent:
- 2:592f01278db4
File content as of revision 5:b8b1a979b0d5:
#include <cmath> #include "CheckWalls.h" using namespace std; const float CheckWalls::WALL_DISTANCE = 100.0f; CheckWalls::CheckWalls(IRSensor& irSensor0, IRSensor& irSensor1, IRSensor& irSensor2, int& wallRight, int& wallFront, int& wallLeft): irSensor0(irSensor0), irSensor1(irSensor1), irSensor2(irSensor2), wallRight(wallRight), wallFront(wallFront), wallLeft(wallLeft) { } CheckWalls::~CheckWalls() {} void CheckWalls::check(){ if (irSensor0.read() < WALL_DISTANCE){ //Abstand zur RECHTEN WAND wallRight = 1; //Wand }else{ wallRight = 0; //keine Wand } if (irSensor1.read() < WALL_DISTANCE){ //Abstand zur WAND VORNE wallFront = 1; //Wand }else{ wallFront = 0; //Keine Wand } if (irSensor2.read() < WALL_DISTANCE){ //Anbstand zur LINKEN WAND wallLeft = 1; //Wand }else{ wallLeft = 0; //keine Wand } }