NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
NXTCam.h
1 
2 // 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 // Large parts of the code is ported from the NXC library for the device,
9 // written by Deepak 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 NXTCam_H
29 #define NXTCam_H
30 
31 #define Cam_Command 0x41
32 #define Cam_Number_Objects 0x42
33 #define Start_Reg 0x43
34 
35 #include "NXShieldI2C.h"
36 
40 class NXTCam : public NXShieldI2C
41 {
42 public:
44  NXTCam(uint8_t i2c_address = 0x02);
45 
49  uint8_t issueCommand(char command);
50 
52  bool sortSize();
53 
55  bool selectObjectMode();
56 
58  bool writeImageRegisters();
59 
61  bool disableTracking();
62 
64  bool enableTracking();
65 
67  bool getColorMap();
68 
70  bool illuminationOn();
71 
73  bool readImageRegisters();
74 
76  bool selectLineMode();
77 
79  bool pingCam();
80 
82  bool resetCam();
83 
85  bool sendColorMap();
86 
88  bool illuminationOff();
89 
91  bool sortColor();
92 
94  bool sortNone();
95 
97  bool camFirmware();
98 
100  int getNumberObjects();
101 
102 
121  void getBlobs(int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom);
122 
123 };
124 
125 #endif
This class implements I2C interfaces used by NXShield.
Definition: NXShieldI2C.h:32
bool resetCam()
Definition: NXTCam.cpp:91
bool sortSize()
Definition: NXTCam.cpp:41
void getBlobs(int *nblobs, uint8_t *color, uint8_t *left, uint8_t *top, uint8_t *right, uint8_t *bottom)
Definition: NXTCam.cpp:126
This class interfaces with NXTCam attached to NXShield.
Definition: NXTCam.h:40
Definition: PiLight.h:42
bool readImageRegisters()
Definition: NXTCam.cpp:76
bool sortNone()
Definition: NXTCam.cpp:116
bool sendColorMap()
Definition: NXTCam.cpp:96
bool camFirmware()
Definition: NXTCam.cpp:111
bool sortColor()
Definition: NXTCam.cpp:106
bool illuminationOff()
Definition: NXTCam.cpp:101
bool disableTracking()
Definition: NXTCam.cpp:56
NXTCam(uint8_t i2c_address=0x02)
Definition: NXTCam.cpp:31
bool pingCam()
Definition: NXTCam.cpp:86
int getNumberObjects()
Definition: NXTCam.cpp:121
bool getColorMap()
Definition: NXTCam.cpp:66
bool selectObjectMode()
Definition: NXTCam.cpp:46
bool illuminationOn()
Definition: NXTCam.cpp:71
uint8_t issueCommand(char command)
Definition: NXTCam.cpp:36
bool writeImageRegisters()
Definition: NXTCam.cpp:51
bool enableTracking()
Definition: NXTCam.cpp:61
bool selectLineMode()
Definition: NXTCam.cpp:81