| 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::EVs_NXTCam
EVs_NXTCam(uint8_t i2c_address=0x02)
Definition: EVs_NXTCam.cpp:32
EVs_NXTCam::pingCam
bool pingCam()
Definition: EVs_NXTCam.cpp:87
EVs_NXTCam::sortSize
bool sortSize()
Definition: EVs_NXTCam.cpp:42
EVs_NXTCam::sendColorMap
bool sendColorMap()
Definition: EVs_NXTCam.cpp:97
color
Definition: EVs_PiLight.h:42
EVs_NXTCam::illuminationOff
bool illuminationOff()
Definition: EVs_NXTCam.cpp:102
EVs_NXTCam::issueCommand
uint8_t issueCommand(char command)
Definition: EVs_NXTCam.cpp:37
EVs_NXTCam::resetCam
bool resetCam()
Definition: EVs_NXTCam.cpp:92
EVs_NXTCam::writeImageRegisters
bool writeImageRegisters()
Definition: EVs_NXTCam.cpp:52
EVs_NXTCam::readImageRegisters
bool readImageRegisters()
Definition: EVs_NXTCam.cpp:77
EVs_NXTCam::disableTracking
bool disableTracking()
Definition: EVs_NXTCam.cpp:57
EVs_NXTCam::illuminationOn
bool illuminationOn()
Definition: EVs_NXTCam.cpp:72
EVs_NXTCam::selectLineMode
bool selectLineMode()
Definition: EVs_NXTCam.cpp:82
EVs_NXTCam
This class interfaces with NXTCam attached to EVShield.
Definition: EVs_NXTCam.h:41
EVs_NXTCam::enableTracking
bool enableTracking()
Definition: EVs_NXTCam.cpp:62
EVShieldI2C
This class implements I2C interfaces used by EVShield.
Definition: EVShieldI2C.h:32
EVs_NXTCam::getColorMap
bool getColorMap()
Definition: EVs_NXTCam.cpp:67
EVs_NXTCam::getNumberObjects
int getNumberObjects()
Definition: EVs_NXTCam.cpp:122
EVs_NXTCam::sortNone
bool sortNone()
Definition: EVs_NXTCam.cpp:117
EVs_NXTCam::sortColor
bool sortColor()
Definition: EVs_NXTCam.cpp:107
EVs_NXTCam::selectObjectMode
bool selectObjectMode()
Definition: EVs_NXTCam.cpp:47
EVs_NXTCam::getBlobs
void getBlobs(int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom)
Definition: EVs_NXTCam.cpp:127
EVs_NXTCam::camFirmware
bool camFirmware()
Definition: EVs_NXTCam.cpp:112