Skip to content

CompassController

andyp13 edited this page Sep 20, 2016 · 1 revision

#CompassController

The class that manages the compass system(s)

#Initialization No inputs. Assumes that the compass is connected to I2C.

##Methods ###Setup Description: Sets up the compass for continuous measurement mode.

###Loop Description: Every 10 milliseconds it gets the measurements from the compass. It also converts the measurements to degrees.

###getDegreeHeading Description: Returns the heading in degrees Output: double

###getAverageHeading Description: Returns the average from the last four readings. Output: double

###getCount Description: Returns the number of times a measurement was read. Output: int

##Variables

Name Type View Description
x int Private The x measurement
y int Private The y measurement
z int Private The z measurement
h double Private The current heading in radians
degreeHeading double Private The current measurement in degrees
lastCheckTime long Private The last time it has measured the heading
currentTime long Private The current time
i int Private number of times the for loop has iterated for the average
average[4] double[] Private The last four heading measurements
count int Private number of times the system has taken measurements

Clone this wiki locally