mit pathdingsbums
Dependencies: mbed
Fork of MicroMouse_MASTER_TWO by
KontrastSensor.cpp
- Committer:
- ruesipat
- Date:
- 2018-04-25
- Revision:
- 6:a09d2ee3b82e
- Parent:
- 2:592f01278db4
- Child:
- 7:5ef09519a6e9
File content as of revision 6:a09d2ee3b82e:
#include <cmath> #include "KontrastSensor.h" using namespace std; //IRSensor::IRSensor(AnalogIn& distance, DigitalOut& bit0, DigitalOut& bit1, DigitalOut& bit2, int number) : // distance(distance), bit0(bit0), bit1(bit1), bit2(bit2) KontrastSensor::KontrastSensor(AnalogIn& kontrast, int& blackLine) : kontrast(kontrast), blackLine(blackLine) { // this->number = number; } KontrastSensor::~KontrastSensor() {} void KontrastSensor::check() { float k = kontrast*3300; //sodass in Range bis 3300mV printf("%.0f\n\r", k); if(k >1300){ blackLine = 1; } //else{//Auschalten im Betrieb (nur zur Kontrolle) // blackLine = 0; //} }