NXShield  v1.07
NXShield Library Reference by OpenElectrons.com
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
NXTUS.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 #ifndef NXTUS_H
23 #define NXTUS_H
24 #include "NXShieldAGS.h"
25 #include "NXShieldI2C.h"
26 #include "NXShield.h"
27 
28 #define NXTUS_Command 0x41
29 #define NXTUS_Distance 0x42
30 
34 class NXTUS : public SoftI2cMaster
35 {
36  NXShield *mp_shield;
37  SH_BankPort m_bp;
38 
39 public:
41  NXTUS(uint8_t devAddr = 0x02);
42 
44  void init(NXShield * shield, SH_BankPort bp=SH_BBS2);
45 
47  uint8_t getDist();
48 
50  char* getFirmwareVersion();
51 
53  char* getVendorID();
54 
56  char* getDeviceID();
57 };
58 
59 #endif
This class implements software i2c interface used by NXShield on Arduino.
Definition: SoftI2cMaster.h:40
This class defines methods to access NXShield features.
Definition: NXShield.h:639
char * getDeviceID()
Definition: NXTUS.cpp:89
Definition: SHDefines.h:53
char * getFirmwareVersion()
Definition: NXTUS.cpp:76
char * getVendorID()
Definition: NXTUS.cpp:82
uint8_t getDist()
Definition: NXTUS.cpp:70
void init(NXShield *shield, SH_BankPort bp=SH_BBS2)
Definition: NXTUS.cpp:30
This class interfaces with LEGO Ultrasonic sensor attached to NXShield.
Definition: NXTUS.h:34
SH_BankPort
Definition: SHDefines.h:49
NXTUS(uint8_t devAddr=0x02)
Definition: NXTUS.cpp:24