NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
EV3InfraRed.h
1 //EV3SensorAdapter.h
2 //
3 /*
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 /*
19  * History
20  * ------------------------------------------------
21  * Author Date Comments
22  * Deepak 11/21/13 Initial Authoring.
23  * M. Giles 01/28/14 Added I2C address, prox, button, beacon, and fully tested
24  */
25 
26 
27 #ifndef EV3_INFRARED_H
28 #define EV3_INFRARED_H
29 
30 #define ESA_Command 0x41
31 
32 #include "NXShieldI2C.h"
33 #include "EV3SensorAdapter.h"
34 
38 typedef enum {
39  MODE_InfraRed_Proximity = 0x00,
40  MODE_InfraRed_Beacon = 0x01,
41  MODE_InfraRed_Remote = 0x02,
42 } MODE_InfraRed;
46 {
47 public:
48  EV3InfraRed(uint8_t i2c_address = 0x32);
50  uint8_t setMode(MODE_InfraRed);
53  int8_t readBeaconHeading(char channel);
56  uint8_t readBeaconProx(char channel);
59  uint8_t readButtonValue(char channel);
62  uint8_t BeaconInRange(char channel);
66 };
67 
68 #endif
int8_t readBeaconHeading(char channel)
Definition: EV3InfraRed.cpp:45
uint8_t BeaconInRange(char channel)
Definition: EV3InfraRed.cpp:76
uint8_t readButtonValue(char channel)
Definition: EV3InfraRed.cpp:67
This class interfaces with sensor attached to NXShield.
Definition: EV3SensorAdapter.h:34
uint8_t readBeaconProx(char channel)
Definition: EV3InfraRed.cpp:54
This class implements EV3 InfraRed Sensor using EV3SensorAdapter.
Definition: EV3InfraRed.h:45
uint8_t setMode(MODE_InfraRed)
Definition: EV3InfraRed.cpp:34