| EVShield v1.3 EVShield Library Reference by mindsensors.com

EVs_PiLight.h
1
2 // PiLight.h
3 //
4 // This is a class for writing to PiLight, made by Openelectrons.
5 // See http://www.openelectrons.com/pages/19
6
7 // Initial version: 2014-03-17 by Michael Giles
8 // Large parts of the code is ported from the Raspberry Pi library for the device,
9 // written by Nitin Patil.
10
11 /*
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Lesser General Public
14 License as published by the Free Software Foundation; either
15 version 2.1 of the License, or (at your option) any later version.
16
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public
23 License along with this library; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27
28 #ifndef EVs_PILIGHT_H
29 #define EVs_PILIGHT_H
30
31 #include "EVShieldI2C.h"
32
33 // Color Registers.
34 #define PILIGHT_RED 0x42
35 #define PILIGHT_GREEN 0x43
36 #define PILIGHT_BLUE 0x44
37
42 struct color
43 {
44 byte r;
45 byte g;
46 byte b;
47 };
48
52 class EVs_PiLight : public EVShieldI2C
53 {
54 public:
56 EVs_PiLight(uint8_t i2c_address = 0x30);
57
62 void readPiLight(color & currcolor);
63
67 void setTimeout1(uint8_t timeoutValue);
68
75 void createPiLight(uint8_t red, uint8_t green, uint8_t blue);
76 };
77 #endif
color
Definition: EVs_PiLight.h:42
color::g
byte g
Definition: EVs_PiLight.h:45
EVs_PiLight
This class interfaces with PiLight sensor attached to EVShield.
Definition: EVs_PiLight.h:52
EVShieldI2C
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
color::r
byte r
Definition: EVs_PiLight.h:44
color::b
byte b
Definition: EVs_PiLight.h:46