Farbsensor richtig
Dependencies: mbed
Fork of Farbesensor by
Farbsensor.h
- Committer:
- EpicG10
- Date:
- 2017-05-04
- Revision:
- 5:f6dfba504545
- Parent:
- 4:f059dd4bff64
File content as of revision 5:f6dfba504545:
#ifndef FARBSENSOR_H #define FARBSENSOR_H #include <cstdlib> #include <mbed.h> #define RED_UPLIMIT 500 //Default limit in mV #define GREEN_DOWNLIMIT 501 //Default limit in mV #define GREEN_UPLIMIT 1200 //Default limit in mV //We need the "FarbEnable" in main for turn on the LED on th sensor (in a DIGITAL OUTPUT) enum Color{ GREEN=1, RED=-1, NOBLOCK=0 }; //just in case class Farbsensor { public: Farbsensor(); Farbsensor(AnalogIn* FarbVoltage); void init(AnalogIn* FarbVoltage); int read(); operator int(); private: AnalogIn* FarbVoltage; }; #endif