mirror of
https://github.com/k3ng/k3ng_rotator_controller.git
synced 2025-03-12 07:13:54 +00:00
2.0.2016083001
Re-merged changes manually from dfannin submitted issue 30 - incorrect index for row_override; pull request 31 (Couldn't get pull from git to compile correctly, not sure why)
This commit is contained in:
parent
82291ceb9b
commit
a32b406582
@ -489,6 +489,10 @@
|
||||
2.0.2016071801
|
||||
Fixed bug with Maidenhead not being calculated when FEATURE_MOON_TRACKING or FEATURE_SUN_TRACKING wasn't compiled
|
||||
|
||||
2.0.2016083001
|
||||
Re-merged changes manually from dfannin submitted issue 30 - incorrect index for row_override; pull request 31
|
||||
(Couldn't get pull from git to compile correctly, not sure why)
|
||||
|
||||
All library files should be placed in directories likes \sketchbook\libraries\library1\ , \sketchbook\libraries\library2\ , etc.
|
||||
in order to compile in Arduino IDE 1.6.7
|
||||
Anything rotator_*.* should be in the ino directory!
|
||||
@ -496,7 +500,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#define CODE_VERSION "2.0.2016071801"
|
||||
#define CODE_VERSION "2.0.2016083001"
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include <EEPROM.h>
|
||||
@ -701,14 +705,6 @@ struct config_t {
|
||||
byte el_stepper_motor_last_pin_state;
|
||||
byte az_stepper_motor_last_direction;
|
||||
byte el_stepper_motor_last_direction;
|
||||
#ifdef FEATURE_TWO_DECIMAL_PLACE_HEADINGS
|
||||
long azimuth_starting_point;
|
||||
long azimuth_rotation_capability;
|
||||
#else
|
||||
int azimuth_starting_point;
|
||||
int azimuth_rotation_capability;
|
||||
#endif
|
||||
byte brake_az_disabled;
|
||||
} configuration;
|
||||
|
||||
|
||||
@ -2278,7 +2274,7 @@ void check_brake_release() {
|
||||
void brake_release(byte az_or_el, byte operation){
|
||||
|
||||
if (az_or_el == AZ) {
|
||||
if (brake_az && (configuration.brake_az_disabled == 0)) {
|
||||
if (brake_az) {
|
||||
if (operation == BRAKE_RELEASE_ON) {
|
||||
digitalWriteEnhanced(brake_az, BRAKE_ACTIVE_STATE);
|
||||
brake_az_engaged = 1;
|
||||
@ -4198,16 +4194,10 @@ void read_settings_from_eeprom(){
|
||||
debug.print(configuration.azimuth_offset,2);
|
||||
debug.print("\nel_offset:");
|
||||
debug.print(configuration.elevation_offset,2);
|
||||
debug.print("az starting point:");
|
||||
debug.print(configuration.azimuth_starting_point);
|
||||
debug.print("az rotation capability:");
|
||||
debug.print(configuration.azimuth_rotation_capability);
|
||||
debug.println("");
|
||||
}
|
||||
#endif // DEBUG_EEPROM
|
||||
|
||||
azimuth_starting_point = configuration.azimuth_starting_point;
|
||||
azimuth_rotation_capability = configuration.azimuth_rotation_capability;
|
||||
|
||||
#if defined(FEATURE_AZ_POSITION_INCREMENTAL_ENCODER)
|
||||
az_incremental_encoder_position = configuration.last_az_incremental_encoder_position;
|
||||
@ -4286,10 +4276,6 @@ void initialize_eeprom_with_defaults(){
|
||||
configuration.last_el_incremental_encoder_position = 0;
|
||||
configuration.azimuth_offset = 0;
|
||||
configuration.elevation_offset = 0;
|
||||
configuration.azimuth_starting_point = AZIMUTH_STARTING_POINT_DEFAULT;
|
||||
configuration.azimuth_rotation_capability = AZIMUTH_ROTATION_CAPABILITY_DEFAULT;
|
||||
configuration.brake_az_disabled = (brake_az ? 1 : 0);
|
||||
|
||||
#ifdef FEATURE_ELEVATION_CONTROL
|
||||
configuration.last_elevation = elevation;
|
||||
#else
|
||||
@ -10037,16 +10023,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte
|
||||
#endif // FEATURE_ELEVATION_CONTROL
|
||||
#endif // defined(FEATURE_AZ_POSITION_ROTARY_ENCODER) || defined(FEATURE_AZ_POSITION_PULSE_INPUT)
|
||||
|
||||
#ifdef FEATURE_TWO_DECIMAL_PLACE_HEADINGS
|
||||
long new_azimuth_starting_point;
|
||||
long new_azimuth_rotation_capability;
|
||||
#else
|
||||
int new_azimuth_starting_point;
|
||||
int new_azimuth_rotation_capability;
|
||||
#endif
|
||||
|
||||
byte brake_az_disabled;
|
||||
|
||||
char temp_string[20] = "";
|
||||
|
||||
switch (input_buffer[1]) {
|
||||
@ -10106,84 +10082,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte
|
||||
break;
|
||||
#endif // defined(FEATURE_AZ_POSITION_ROTARY_ENCODER) || defined(FEATURE_AZ_POSITION_PULSE_INPUT)
|
||||
|
||||
case 'I': // \Ix[x][x] - set az starting point
|
||||
new_azimuth_starting_point = 9999;
|
||||
switch (input_buffer_index) {
|
||||
case 2:
|
||||
new_azimuth_starting_point = configuration.azimuth_starting_point;
|
||||
break;
|
||||
case 3:
|
||||
new_azimuth_starting_point = (input_buffer[2] - 48);
|
||||
break;
|
||||
case 4:
|
||||
new_azimuth_starting_point = ((input_buffer[2] - 48) * 10) + (input_buffer[3] - 48);
|
||||
break;
|
||||
case 5:
|
||||
new_azimuth_starting_point = ((input_buffer[2] - 48) * 100) + ((input_buffer[3] - 48) * 10) + (input_buffer[4] - 48);
|
||||
break;
|
||||
}
|
||||
if ((new_azimuth_starting_point >= 0) && (new_azimuth_starting_point < 360)) {
|
||||
if (input_buffer_index > 2) {
|
||||
azimuth_starting_point = configuration.azimuth_starting_point = new_azimuth_starting_point;
|
||||
configuration_dirty = 1;
|
||||
}
|
||||
strcpy(return_string, "Azimuth starting point set to ");
|
||||
dtostrf(new_azimuth_starting_point, 0, 0, temp_string);
|
||||
strcat(return_string, temp_string);
|
||||
} else {
|
||||
strcpy(return_string, "Error. Format: \\Ix[x][x]");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'J': // \Jx[x][x] - set az rotation capability
|
||||
new_azimuth_rotation_capability = 9999;
|
||||
switch (input_buffer_index) {
|
||||
case 2:
|
||||
new_azimuth_rotation_capability = configuration.azimuth_rotation_capability;
|
||||
break;
|
||||
case 3:
|
||||
new_azimuth_rotation_capability = (input_buffer[2] - 48);
|
||||
break;
|
||||
case 4:
|
||||
new_azimuth_rotation_capability = ((input_buffer[2] - 48) * 10) + (input_buffer[3] - 48);
|
||||
break;
|
||||
case 5:
|
||||
new_azimuth_rotation_capability = ((input_buffer[2] - 48) * 100) + ((input_buffer[3] - 48) * 10) + (input_buffer[4] - 48);
|
||||
break;
|
||||
}
|
||||
if ((new_azimuth_rotation_capability >= 0) && (new_azimuth_rotation_capability <= 450)) {
|
||||
if (input_buffer_index > 2) {
|
||||
azimuth_rotation_capability = configuration.azimuth_rotation_capability = new_azimuth_rotation_capability;
|
||||
configuration_dirty = 1;
|
||||
}
|
||||
strcpy(return_string, "Azimuth rotation capability set to ");
|
||||
dtostrf(new_azimuth_rotation_capability, 0, 0, temp_string);
|
||||
strcat(return_string, temp_string);
|
||||
} else {
|
||||
strcpy(return_string, "Error. Format: \\Jx[x][x]");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'K': // \Kx - Force disable the az brake even if a pin is defined (x: 0 = enable, 1 = disable)
|
||||
brake_az_disabled = 2;
|
||||
if (input_buffer_index == 2) {
|
||||
brake_az_disabled = configuration.brake_az_disabled;
|
||||
} else
|
||||
switch (input_buffer[2]) {
|
||||
case '0': brake_az_disabled = 0; break;
|
||||
case '1': brake_az_disabled = 1; break;
|
||||
}
|
||||
if ((brake_az_disabled >=0) && (brake_az_disabled <= 1)) {
|
||||
if (input_buffer_index > 2) {
|
||||
configuration.brake_az_disabled = brake_az_disabled;
|
||||
configuration_dirty = 1;
|
||||
}
|
||||
strcpy(return_string, "Az brake ");
|
||||
strcat(return_string, (brake_az_disabled ? "disabled." : "enabled."));
|
||||
} else {
|
||||
strcpy(return_string, "Error.");
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(FEATURE_ELEVATION_CONTROL)
|
||||
#if defined(FEATURE_EL_POSITION_ROTARY_ENCODER) || defined(FEATURE_EL_POSITION_PULSE_INPUT)
|
||||
@ -10303,27 +10201,21 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte
|
||||
#endif // FEATURE_CLOCK
|
||||
|
||||
|
||||
case 'D': // \D - Debug
|
||||
case 'D':
|
||||
if (debug_mode & source_port) {
|
||||
debug_mode = debug_mode & (~source_port);
|
||||
} else {
|
||||
debug_mode = debug_mode | source_port;
|
||||
}
|
||||
break;
|
||||
break; // D - Debug
|
||||
|
||||
case 'E': // \E - Initialize eeprom
|
||||
case 'E': // E - Initialize eeprom
|
||||
initialize_eeprom_with_defaults();
|
||||
strcpy(return_string, "Initialized eeprom, resetting unit in 5 seconds...");
|
||||
reset_the_unit = 1;
|
||||
break;
|
||||
|
||||
case 'Q': // \Q - Save settings in the EEPROM and restart
|
||||
write_settings_to_eeprom();
|
||||
strcpy(return_string, "Settings saved in EEPROM, resetting unit in 5 seconds...");
|
||||
reset_the_unit = 1;
|
||||
break;
|
||||
|
||||
case 'L': // \L - rotate to long path
|
||||
case 'L': // L - rotate to long path
|
||||
if (azimuth < (180 * HEADING_MULTIPLIER)) {
|
||||
submit_request(AZ, REQUEST_AZIMUTH, (azimuth + (180 * HEADING_MULTIPLIER)), 15);
|
||||
} else {
|
||||
@ -12066,7 +11958,6 @@ void process_yaesu_command(byte * yaesu_command_buffer, int yaesu_command_buffer
|
||||
|
||||
break;
|
||||
case 'Z': // Z - Starting point toggle
|
||||
|
||||
if (azimuth_starting_point == 180) {
|
||||
azimuth_starting_point = 0;
|
||||
strcpy(return_string,"N");
|
||||
|
@ -16,11 +16,11 @@
|
||||
#define FEATURE_YAESU_EMULATION // uncomment this for Yaesu GS-232 emulation on control port
|
||||
// #define FEATURE_EASYCOM_EMULATION // Easycom protocol emulation on control port (undefine FEATURE_YAESU_EMULATION above)
|
||||
|
||||
// #define FEATURE_MOON_TRACKING
|
||||
// #define FEATURE_SUN_TRACKING
|
||||
// #define FEATURE_CLOCK
|
||||
// #define FEATURE_GPS
|
||||
// #define FEATURE_RTC_DS1307
|
||||
#define FEATURE_MOON_TRACKING
|
||||
#define FEATURE_SUN_TRACKING
|
||||
#define FEATURE_CLOCK
|
||||
#define FEATURE_GPS
|
||||
#define FEATURE_RTC_DS1307
|
||||
// #define FEATURE_RTC_PCF8583
|
||||
// #define FEATURE_ETHERNET
|
||||
// #define FEATURE_STEPPER_MOTOR // requires Mega or an AVR with Timer 5 support
|
||||
@ -67,7 +67,7 @@
|
||||
// #define FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER
|
||||
|
||||
// And if you are using an Adafruit, Yourduino, RFRobot, YWRobot, or SainSmart display, you must also change the feature setting in rotator_k3ngdisplay.h!!!!
|
||||
// #define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common)
|
||||
#define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common)
|
||||
// #define FEATURE_ADAFRUIT_I2C_LCD
|
||||
// #define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons (also set this feature in rotator_k3ngdisplay.h)
|
||||
// #define FEATURE_YOURDUINO_I2C_LCD
|
||||
|
@ -142,7 +142,7 @@ You can tweak these, but read the online documentation!
|
||||
#define BRAKE_ACTIVE_STATE HIGH
|
||||
#define BRAKE_INACTIVE_STATE LOW
|
||||
|
||||
#define EEPROM_MAGIC_NUMBER 106
|
||||
#define EEPROM_MAGIC_NUMBER 105
|
||||
#define EEPROM_WRITE_DIRTY_CONFIG_TIME 30 //time in seconds
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user