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

EVs_LightSensorArray.h
1
2 // EVs_LightSensorArray.h
3 //
4 // This is a class for reading from LightSensorArray made by Mindsensors.
5 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=168
6
7 // Initial version: 2013-01-25 by Michael Giles
8 // Modified for EVShield: 2015-02-16 by Michael Giles
9 // Large parts of the code is ported from the NXC library for the device,
10 // written by Deepak Patil.
11
12 /*
13 This library is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 2.1 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28
29 #ifndef EVs_LightSensorArray_H
30 #define EVs_LightSensorArray_H
31
32 #define LightSensorArray_Calibrated 0x42
33 #define LightSensorArray_Uncalibrated 0x6A
34 #define LightSensorArray_White_Limit 0x4A
35 #define LightSensorArray_Black_Limit 0x52
36 #define LightSensorArray_White_Calibration 0x5A
37 #define LightSensorArray_Black_Calibration 0x62
38
39 #define LightSensorArray_Command 0x41
40
41 #include "EVShieldI2C.h"
42
43
46 class EVs_LightSensorArray : public EVShieldI2C
47 {
48 public:
50 EVs_LightSensorArray(uint8_t i2c_address = 0x02);
51
53 uint8_t issueCommand(char command);
54
56 bool calibrateWhite();
57
59 bool calibrateBlack();
60
62 bool sleep();
63
65 bool wakeUp();
66
68 bool configureUS();
69
71 bool configureEurope();
72
74 bool configureUniversal();
75
78 uint8_t* getCalibrated();
79
82 uint8_t* getUncalibrated();
83
85 uint8_t* getWhiteLimit();
86
88 uint8_t* getBlackLimit();
89
92 uint8_t* getWhiteCalibration();
93
96 uint8_t* getBlackCalibration();
97
98 };
99
100 #endif
EVs_LightSensorArray::getBlackLimit
uint8_t * getBlackLimit()
Definition: EVs_LightSensorArray.cpp:92
EVs_LightSensorArray::calibrateWhite
bool calibrateWhite()
Definition: EVs_LightSensorArray.cpp:42
EVs_LightSensorArray::getBlackCalibration
uint8_t * getBlackCalibration()
Definition: EVs_LightSensorArray.cpp:102
EVs_LightSensorArray::issueCommand
uint8_t issueCommand(char command)
Definition: EVs_LightSensorArray.cpp:37
EVs_LightSensorArray::getUncalibrated
uint8_t * getUncalibrated()
Definition: EVs_LightSensorArray.cpp:82
EVs_LightSensorArray::configureEurope
bool configureEurope()
Definition: EVs_LightSensorArray.cpp:67
EVs_LightSensorArray::EVs_LightSensorArray
EVs_LightSensorArray(uint8_t i2c_address=0x02)
Definition: EVs_LightSensorArray.cpp:32
EVs_LightSensorArray::sleep
bool sleep()
Definition: EVs_LightSensorArray.cpp:52
EVs_LightSensorArray::wakeUp
bool wakeUp()
Definition: EVs_LightSensorArray.cpp:57
EVs_LightSensorArray::getCalibrated
uint8_t * getCalibrated()
Definition: EVs_LightSensorArray.cpp:77
EVs_LightSensorArray
This class interfaces with LightSensorArray attached to EVShield.
Definition: EVs_LightSensorArray.h:46
EVShieldI2C
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
EVs_LightSensorArray::getWhiteLimit
uint8_t * getWhiteLimit()
Definition: EVs_LightSensorArray.cpp:87
EVs_LightSensorArray::configureUS
bool configureUS()
Definition: EVs_LightSensorArray.cpp:62
EVs_LightSensorArray::calibrateBlack
bool calibrateBlack()
Definition: EVs_LightSensorArray.cpp:47
EVs_LightSensorArray::configureUniversal
bool configureUniversal()
Definition: EVs_LightSensorArray.cpp:72
EVs_LightSensorArray::getWhiteCalibration
uint8_t * getWhiteCalibration()
Definition: EVs_LightSensorArray.cpp:97