aiu
Dependents: jumpROBO4_3 jumpROBO5_0 jumpROBO5_2 TX_Coloers ... more
ColorSensor.h
- Committer:
- OGA
- Date:
- 2013-09-23
- Revision:
- 0:745c9de82674
File content as of revision 0:745c9de82674:
#include "mbed.h" #define RED 0 #define GREEN 1 #define BLUE 2 #define OTHER 3 class ColorSensor { private: DigitalIn *Dout; DigitalOut *Range; DigitalOut *CK; DigitalOut *Gate; int time; double R, G, B; public: ColorSensor(PinName Dout, PinName Range, PinName CK, PinName Gate, int time); ColorSensor(void); void getRGB(unsigned short RGB[]); void getRGB(unsigned& R, unsigned& G, unsigned& B); unsigned checkRGB(unsigned& R, unsigned& G, unsigned& B); int judge(); void setWhite(); };