colorsensor +a
Fork of ColorSensor by
Embed:
(wiki syntax)
Show/hide line numbers
ColorSensor.h
00001 #include "mbed.h" 00002 #define RED 0 00003 #define GREEN 1 00004 #define BLUE 2 00005 #define OTHER 3 00006 class ColorSensor 00007 { 00008 private: 00009 DigitalIn *Dout; 00010 DigitalOut *Range; 00011 DigitalOut *CK; 00012 DigitalOut *Gate; 00013 int time; 00014 double R, G, B; 00015 public: 00016 ColorSensor(PinName Dout, PinName Range, PinName CK, PinName Gate, int time); 00017 ColorSensor(void); 00018 void getRGB(unsigned short RGB[]); 00019 void getRGB(unsigned& R, unsigned& G, unsigned& B); 00020 unsigned checkRGB(unsigned& R, unsigned& G, unsigned& B); 00021 int judge(); 00022 void setWhite(); 00023 void timenow(unsigned short times); 00024 };
Generated on Wed Jul 20 2022 12:23:40 by 1.7.2