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.
Fork of Versuch20 by
LHR.cpp
00001 #include "LHR.h" 00002 #include "EncoderCounter.h" 00003 #include "Controller.h" 00004 #include "IRSensorGF.h" 00005 #include "IRSensorG.h" 00006 #include "IRSensorK.h" 00007 #include "IRSensorZ.h" 00008 00009 00010 using namespace std; 00011 00012 LHR::LHR(IRSensorGF& Sensor1, IRSensorG& Sensor2, IRSensorG& Sensor3, IRSensorK& Sensor4, IRSensorK& Sensor5, IRSensorZ& Sensor6): 00013 Sensor1(Sensor1), Sensor2(Sensor2), Sensor3(Sensor3), Sensor4(Sensor4), Sensor5(Sensor5), Sensor6(Sensor6) 00014 { 00015 this->D = D; 00016 } 00017 00018 00019 LHR::~LHR() {} 00020 00021 int LHR::moving() 00022 { 00023 if(/*Sensor6.read() == 0*/1) { //Ziel erreicht 00024 00025 if(Sensor4.read() == 0) { 00026 D=1; 00027 //wait(0.1f); //links Drehen 00028 } else if (Sensor1.read() > 150 ) { 00029 D=2; 00030 //wait(0.1f); //gerade 00031 } else if (Sensor5.read() == 0) { 00032 D=3; 00033 //wait(0.1f); 00034 } else { 00035 D=4; 00036 } 00037 00038 } 00039 return D; 00040 }
Generated on Sun Jul 17 2022 11:46:13 by
