EVShield  v1.3
EVShield Library Reference by mindsensors.com
EVs_NXTCam.h
1 
2 // EVs_NXTCam.h
3 //
4 // This is a class for controlling the NXT Cam, made by Mindsensors.
5 // See http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=78 .
6 
7 // Initial version: 2010-06-18 by Andrew Sylvester
8 // Modified for EVShield: 2015-02-15 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_NXTCam_H
30 #define EVs_NXTCam_H
31 
32 #define Cam_Command 0x41
33 #define Cam_Number_Objects 0x42
34 #define Start_Reg 0x43
35 
36 #include "EVShieldI2C.h"
37 
41 class EVs_NXTCam : public EVShieldI2C
42 {
43 public:
45  EVs_NXTCam(uint8_t i2c_address = 0x02);
46 
50  uint8_t issueCommand(char command);
51 
53  bool sortSize();
54 
56  bool selectObjectMode();
57 
59  bool writeImageRegisters();
60 
62  bool disableTracking();
63 
65  bool enableTracking();
66 
68  bool getColorMap();
69 
71  bool illuminationOn();
72 
74  bool readImageRegisters();
75 
77  bool selectLineMode();
78 
80  bool pingCam();
81 
83  bool resetCam();
84 
86  bool sendColorMap();
87 
89  bool illuminationOff();
90 
92  bool sortColor();
93 
95  bool sortNone();
96 
98  bool camFirmware();
99 
101  int getNumberObjects();
102 
103 
122  void getBlobs(int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom);
123 
124 };
125 
126 #endif
EVs_NXTCam(uint8_t i2c_address=0x02)
Definition: EVs_NXTCam.cpp:32
bool pingCam()
Definition: EVs_NXTCam.cpp:87
bool sortSize()
Definition: EVs_NXTCam.cpp:42
bool sendColorMap()
Definition: EVs_NXTCam.cpp:97
Definition: EVs_PiLight.h:42
bool illuminationOff()
Definition: EVs_NXTCam.cpp:102
uint8_t issueCommand(char command)
Definition: EVs_NXTCam.cpp:37
bool resetCam()
Definition: EVs_NXTCam.cpp:92
bool writeImageRegisters()
Definition: EVs_NXTCam.cpp:52
bool readImageRegisters()
Definition: EVs_NXTCam.cpp:77
bool disableTracking()
Definition: EVs_NXTCam.cpp:57
bool illuminationOn()
Definition: EVs_NXTCam.cpp:72
bool selectLineMode()
Definition: EVs_NXTCam.cpp:82
This class interfaces with NXTCam attached to EVShield.
Definition: EVs_NXTCam.h:41
bool enableTracking()
Definition: EVs_NXTCam.cpp:62
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
bool getColorMap()
Definition: EVs_NXTCam.cpp:67
int getNumberObjects()
Definition: EVs_NXTCam.cpp:122
bool sortNone()
Definition: EVs_NXTCam.cpp:117
bool sortColor()
Definition: EVs_NXTCam.cpp:107
bool selectObjectMode()
Definition: EVs_NXTCam.cpp:47
void getBlobs(int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom)
Definition: EVs_NXTCam.cpp:127
bool camFirmware()
Definition: EVs_NXTCam.cpp:112