Kommt ins Ziwl
Dependencies: mbed
Fork of Roboshark_V7 by
Diff: IRSensor.h
- Revision:
- 4:767fd282dd9c
- Parent:
- 0:6d0671ae4648
- Child:
- 6:7bbcdd07bc2d
--- a/IRSensor.h Mon Apr 23 12:19:12 2018 +0000 +++ b/IRSensor.h Tue Apr 24 18:16:05 2018 +0000 @@ -12,7 +12,7 @@ class IRSensor { public: - IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F); + IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F, AnalogIn& LineSensor); float disR; float disL; @@ -24,6 +24,7 @@ float measR; float measL; float measF; + double Line; virtual ~IRSensor(); float readR(); @@ -32,11 +33,15 @@ int codeR(); int codeL(); int codeF(); + void codeB(); + int get_ende(); + int ende; private: AnalogIn& IrRight; AnalogIn& IrLeft; AnalogIn& IrFront; + AnalogIn& LineSensor; float dis2R; float dis2L; float dis2F; @@ -58,6 +63,11 @@ static const int minIrR; static const int minIrL; static const int minIrF; + static const float Period; + double line; + bool finish; + bool finishLast; + Ticker ticker; };