| EVShield v1.3 EVShield Library Reference by mindsensors.com

EVs_SumoEyes.h
1
2 /*
3 * EVShield interface library
4 * Copyright (C) 2011 mindsensors.com
5 *
6 * This file is part of EVShield 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 EVs_SUMOEYES_H
24 #define EVs_SUMOEYES_H
25
26 #include "EVShieldAGS.h"
27
28 typedef enum {
29 SE_None = 0,
30 SE_Front,
31 SE_Left,
32 SE_Right
33 } SE_Zone;
34
38 class EVs_SumoEyes : public EVShieldAGS
39 {
40 public:
42 bool init(EVShield * 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
EVShieldAGS
EVShield Analog Sensor class.
Definition: EVShieldAGS.h:32
EVs_SumoEyes
This class interfaces with EVTSumoEyes sensor attached to EVShield.
Definition: EVs_SumoEyes.h:38
EVs_SumoEyes::setLongRange
bool setLongRange()
Definition: EVs_SumoEyes.cpp:54
EVs_SumoEyes::detectObstacleZone
SE_Zone detectObstacleZone()
Definition: EVs_SumoEyes.cpp:68
EVs_SumoEyes::setType
bool setType(int8_t type)
Definition: EVs_SumoEyes.cpp:30
EVs_SumoEyes::init
bool init(EVShield *shield, SH_BankPort bp)
Definition: EVs_SumoEyes.cpp:24
EVShield
This class defines methods to access EVShield features.
Definition: EVShield.h:694
EVs_SumoEyes::OBZoneToString
char * OBZoneToString(SE_Zone ob)
Definition: EVs_SumoEyes.cpp:81
SH_BankPort
SH_BankPort
Definition: SHDefines.h:52
EVs_SumoEyes::setShortRange
bool setShortRange()
Definition: EVs_SumoEyes.cpp:49