WPILib 2012
WPILibRoboticsLibraryforFRC
HiTechnicCompass.h
00001 /*----------------------------------------------------------------------------*/
00002 /* Copyright (c) FIRST 2008. All Rights Reserved.                                                         */
00003 /* Open Source Software - may be modified and shared by FRC teams. The code   */
00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
00005 /*----------------------------------------------------------------------------*/
00006 
00007 #ifndef __HiTechnicCompass_h__
00008 #define __HiTechnicCompass_h__
00009 
00010 #include "SensorBase.h"
00011 
00012 class I2C;
00013 
00026 class HiTechnicCompass : public SensorBase
00027 {
00028 public:
00029         explicit HiTechnicCompass(UINT8 moduleNumber);
00030         virtual ~HiTechnicCompass();
00031         float GetAngle();
00032 
00033 private:
00034         static const UINT8 kAddress = 0x02;
00035         static const UINT8 kManufacturerBaseRegister = 0x08;
00036         static const UINT8 kManufacturerSize = 0x08;
00037         static const UINT8 kSensorTypeBaseRegister = 0x10;
00038         static const UINT8 kSensorTypeSize = 0x08;
00039         static const UINT8 kHeadingRegister = 0x44;
00040 
00041         I2C* m_i2c;
00042 };
00043 
00044 #endif
00045 
 All Classes Functions Variables