101 Some Variables in the Sketch - k3ng/k3ng_rotator_controller GitHub Wiki

A short description of what some of the variable names are and their meaning

The main sketch k3ng_rotator_controller.ino uses a number of variable labels to refer to various instances of 'azimuth'.

The following list is the best description that I can deduce for each variable.

analog_az = analogReadEnhanced(rotator_analog_az);

This is the value read by the ADC on the Arduino. The range of this variable is 0 - 1023

raw_azimuth = float_map(analog_az, configuration.analog_az_full_ccw, configuration.analog_az_full_cw, configuration.azimuth_starting_point, (configuration.azimuth_starting_point + configuration.azimuth_rotation_capability));

So, the raw_azimuth is determined by mapping the range of possible values from the ADC, to the range of possible headings. For example, for a 450 degree north centered rotator, which has a starting azimuth AZIMUTH_STARTING_POINT_DEFAULT of 135 and AZIMUTH_ROTATION_CAPABILITY_DEFAULT of 450, the raw_azimuth could have a value anywhere from 135 to 585.

azimuth (might also be referred to as real_azimuth) is always a value between 0 and 359. This value is displayed as the heading.

apply_azimuth_offset();
Applies azimuth_offset to raw_azimuth, (but oddly, only for negative values of azimuth_offset).

convert_raw_azimuth_to_real_azimuth(); for positive values of raw_azimuth, it removes integer multiples of 360 from the raw_azimuth value, otherwise for negative values of raw_azimuth it adds 360 to raw_azimuth;

heading is a variable used for many non-potentiometer position sensors.

bearing is used in calculating satellite position and also could be the direction to a remote lat/long or maidenhead.