Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: jumpROBO4_3 jumpROBO5_0 jumpROBO5_2 TX_Coloers ... more
ColorSensor.h@0:745c9de82674, 2013-09-23 (annotated)
- Committer:
- OGA
- Date:
- Mon Sep 23 06:30:00 2013 +0000
- Revision:
- 0:745c9de82674
colorsensor
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| OGA | 0:745c9de82674 | 1 | #include "mbed.h" |
| OGA | 0:745c9de82674 | 2 | #define RED 0 |
| OGA | 0:745c9de82674 | 3 | #define GREEN 1 |
| OGA | 0:745c9de82674 | 4 | #define BLUE 2 |
| OGA | 0:745c9de82674 | 5 | #define OTHER 3 |
| OGA | 0:745c9de82674 | 6 | class ColorSensor |
| OGA | 0:745c9de82674 | 7 | { |
| OGA | 0:745c9de82674 | 8 | private: |
| OGA | 0:745c9de82674 | 9 | DigitalIn *Dout; |
| OGA | 0:745c9de82674 | 10 | DigitalOut *Range; |
| OGA | 0:745c9de82674 | 11 | DigitalOut *CK; |
| OGA | 0:745c9de82674 | 12 | DigitalOut *Gate; |
| OGA | 0:745c9de82674 | 13 | int time; |
| OGA | 0:745c9de82674 | 14 | double R, G, B; |
| OGA | 0:745c9de82674 | 15 | public: |
| OGA | 0:745c9de82674 | 16 | ColorSensor(PinName Dout, PinName Range, PinName CK, PinName Gate, int time); |
| OGA | 0:745c9de82674 | 17 | ColorSensor(void); |
| OGA | 0:745c9de82674 | 18 | void getRGB(unsigned short RGB[]); |
| OGA | 0:745c9de82674 | 19 | void getRGB(unsigned& R, unsigned& G, unsigned& B); |
| OGA | 0:745c9de82674 | 20 | unsigned checkRGB(unsigned& R, unsigned& G, unsigned& B); |
| OGA | 0:745c9de82674 | 21 | int judge(); |
| OGA | 0:745c9de82674 | 22 | void setWhite(); |
| OGA | 0:745c9de82674 | 23 | }; |