9#ifndef GENERAL_COMPASS_H
10#define GENERAL_COMPASS_H
70 int16_t re_zero_heading;
86 int16_t get_eeprom_re_zero_heading ();
bool reset_heading()
Takes the current heading of compass as zero.
Definition General_compass.cpp:131
int16_t get_raw_y()
Gets the magnetic field strength in Y-axis in raw value.
Definition General_compass.cpp:23
double get_uT_x()
Gets the magnetic field strength in X-axis in µT (microTesla).
Definition General_compass.cpp:27
Mag_field_uT_t get_uT_mag()
Gets a package of magnetic field strengths in 3 axes in µT (microTesla).
Definition General_compass.cpp:30
double get_uT_z()
Gets the magnetic field strength in Z-axis in µT (microTesla).
Definition General_compass.cpp:29
void set_cal_vals(Compass_cal_vals_t vals)
Sets the calibration values.
Definition General_compass.cpp:36
Compass_cal_vals_t get_prev_caled_vals()
Gets the previously calibrated values of the compass.
Definition General_compass.cpp:87
int16_t get_raw_x()
Gets the magnetic field strength in X-axis in raw value.
Definition General_compass.cpp:22
Mag_field_raw_t get_raw_mag()
Gets a package of magnetic field strengths in 3 axes in raw value.
Definition General_compass.cpp:25
Compass_cal_vals_t get_eeprom_caled_vals()
Loads calibration values from EEPROM.
Definition General_compass.cpp:111
virtual double raw_to_uT(const int16_t raw)=0
The function to convert raw values to field strength in microTesla.
virtual bool update()=0
Fetches and updates new data from the compass.
virtual uint16_t get_heading()
Gets the heading of compass in degrees.
Definition General_compass.cpp:169
void set_raw_data(Mag_field_raw_t data)
Sets the latest raw values of magnetic field strength in 3 axes.
Definition General_compass.cpp:32
bool compass_cal()
Calibrates the compass, and find the ranges of each axis respectively for compass usage.
Definition General_compass.cpp:40
int16_t get_re_zero_heading()
Gets the real-world heading referenced as zero-degrees.
Definition General_compass.cpp:147
double get_uT_y()
Gets the magnetic field strength in Y-axis in µT (microTesla).
Definition General_compass.cpp:28
int16_t get_raw_z()
Gets the magnetic field strength in Z-axis in raw value.
Definition General_compass.cpp:24
void use_eeprom_re_zero_heading()
Uses the re-zero heading from EEPROM.
Definition General_compass.cpp:165
General_compass()
Creates a General_compass object.
Definition General_compass.cpp:13
void save_caled_vals()
Saves the calibrated values into local EEPROM.
Definition General_compass.cpp:91
void save_re_zero_heading()
Saves the real-world heading referenced as zero-degrees into local EEPROM.
Definition General_compass.cpp:151
Heading_sensor()
Creates a Heading_sensor object.
Definition Heading_sensor.h:28
Calibration values of a compass.
Definition General_compass.h:43
Mag_field_raw_t base
Hard iron calibration value.
Definition General_compass.h:47
Mag_field_raw_t range
Soft iron calibration value.
Definition General_compass.h:51
Magnetic field strength (in raw values) packet.
Definition General_compass.h:24
Magnetic field strength (in microTesla) packet.
Definition General_compass.h:35