NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
SumoEyes.h
1 
2 /*
3  * NXShield interface library
4  * Copyright (C) 2011 mindsensors.com
5  *
6  * This file is part of NXShield interface library.
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 
22 
23 #ifndef SUMOEYES_H
24 #define SUMOEYES_H
25 
26 #include "NXShieldAGS.h"
27 
28 typedef enum {
29  SE_None = 0,
30  SE_Front,
31  SE_Left,
32  SE_Right
33 } SE_Zone;
34 
38 class SumoEyes : public NXShieldAGS
39 {
40 public:
42  bool init(NXShield * shield, SH_BankPort bp);
43 
45  bool setType(int8_t type);
46 
48  bool setLongRange();
49 
51  bool setShortRange();
52 
54  SE_Zone detectObstacleZone();
55 
57  char *OBZoneToString(SE_Zone ob);
58 
59 private:
60  bool isNear(int reference, int delta, int comet);
61 
62 };
63 
64 #endif
65 
66 
This class defines methods to access NXShield features.
Definition: NXShield.h:639
bool init(NXShield *shield, SH_BankPort bp)
Definition: SumoEyes.cpp:24
This class interfaces with NXTSumoEyes sensor attached to NXShield.
Definition: SumoEyes.h:38
SE_Zone detectObstacleZone()
Definition: SumoEyes.cpp:68
bool setShortRange()
Definition: SumoEyes.cpp:49
char * OBZoneToString(SE_Zone ob)
Definition: SumoEyes.cpp:81
bool setType(int8_t type)
Definition: SumoEyes.cpp:30
bool setLongRange()
Definition: SumoEyes.cpp:54
SH_BankPort
Definition: SHDefines.h:49
NXShield Analog Sensor class.
Definition: NXShieldAGS.h:31