WPILib  2014.0
WPIRoboticsLibraryforFRC
 All Classes Functions Variables Pages
HiTechnicCompass.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #ifndef __HiTechnicCompass_h__
8 #define __HiTechnicCompass_h__
9 
10 #include "SensorBase.h"
11 #include "LiveWindow/LiveWindowSendable.h"
12 
13 class I2C;
14 
27 class HiTechnicCompass : public SensorBase, public LiveWindowSendable
28 {
29 public:
30  explicit HiTechnicCompass(uint8_t moduleNumber);
31  virtual ~HiTechnicCompass();
32  float GetAngle();
33 
34  void UpdateTable();
35  void StartLiveWindowMode();
36  void StopLiveWindowMode();
37  std::string GetSmartDashboardType();
38  void InitTable(ITable *subTable);
39  ITable * GetTable();
40 
41 private:
42  static const uint8_t kAddress = 0x02;
43  static const uint8_t kManufacturerBaseRegister = 0x08;
44  static const uint8_t kManufacturerSize = 0x08;
45  static const uint8_t kSensorTypeBaseRegister = 0x10;
46  static const uint8_t kSensorTypeSize = 0x08;
47  static const uint8_t kHeadingRegister = 0x44;
48 
49  I2C* m_i2c;
50 
51  ITable *m_table;
52 };
53 
54 #endif
55 
virtual ~HiTechnicCompass()
Definition: HiTechnicCompass.cpp:56
HiTechnicCompass(uint8_t moduleNumber)
Definition: HiTechnicCompass.cpp:26
Definition: HiTechnicCompass.h:27
Definition: SensorBase.h:20
float GetAngle()
Definition: HiTechnicCompass.cpp:69
Definition: I2C.h:22