From d31491476f7439f6a9af4696106daaf9989a9518 Mon Sep 17 00:00:00 2001 From: Anthony Good Date: Sat, 5 Sep 2015 07:56:53 -0400 Subject: [PATCH] 2.0.2015090402 #include "rotator_language.h" OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS /?FS command - Full Status Report --- k3ng_rotator_controller.ino | 1237 +----------------------------- libraries/k3ngdisplay.cpp | 4 +- libraries/k3ngdisplay.h | 5 +- rotator_command_processing.h | 325 +++++--- rotator_ethernet.h | 36 +- rotator_features.h | 65 +- rotator_features_ea4tx_ars_usb.h | 12 +- rotator_features_m0upu.h | 28 +- rotator_features_test.h | 80 +- rotator_language.h | 270 +++++++ rotator_pins_test.h | 9 + rotator_settings.h | 317 +------- rotator_settings_ea4tx_ars_usb.h | 282 +------ rotator_settings_m0upu.h | 219 +----- rotator_settings_test.h | 338 ++------ rotator_settings_wb6kcn.h | 260 ++----- 16 files changed, 755 insertions(+), 2732 deletions(-) create mode 100644 rotator_language.h diff --git a/k3ng_rotator_controller.ino b/k3ng_rotator_controller.ino index afddb58..8be65f1 100644 --- a/k3ng_rotator_controller.ino +++ b/k3ng_rotator_controller.ino @@ -396,9 +396,14 @@ #include "rotator_moon_and_sun.h" #include "rotator_ethernet.h" #include "rotator_stepper.h" + + 2.0.2015090402 + #include "rotator_language.h" + OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS + /?FS command - Full Status Report */ -#define CODE_VERSION "2.0.2015090401" +#define CODE_VERSION "2.0.2015090402" #include #include @@ -425,26 +430,9 @@ #include "rotator_dependencies.h" -#ifndef UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY - #ifdef FEATURE_4_BIT_LCD_DISPLAY - #include // required for classic 4 bit interface LCD display (FEATURE_4_BIT_LCD_DISPLAY) - #endif // FEATURE_4_BIT_LCD_DISPLAY - #if defined(FEATURE_ADAFRUIT_I2C_LCD) - #include // required for Adafruit I2C LCD display - #include // required for Adafruit I2C LCD display - #endif - #if defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_RFROBOT_I2C_DISPLAY) - #include // required for YourDuino.com or DFRobot I2C LCD display - #endif - #if defined(FEATURE_YOURDUINO_I2C_LCD) - #include // required for YourDuino.com I2C LCD display - #endif -#else - #ifdef FEATURE_LCD_DISPLAY - #include "k3ngdisplay.h" - #endif -#endif //UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY - +#ifdef FEATURE_LCD_DISPLAY + #include "k3ngdisplay.h" +#endif #ifdef FEATURE_WIRE_SUPPORT #include // required for FEATURE_I2C_LCD, any ADXL345 feature, FEATURE_AZ_POSITION_HMC5883L, FEATURE_EL_POSITION_ADAFRUIT_LSM303 @@ -498,7 +486,6 @@ #include "rotator_pins_m0upu.h" #endif #ifdef HARDWARE_WB6KCN - //#include "rotator_pins_wb6kcn_az_test_setup.h" #include "rotator_pins_wb6kcn.h" #endif #ifdef HARDWARE_TEST @@ -644,14 +631,6 @@ byte current_az_speed_voltage = 0; byte elevation_button_was_pushed = 0; #endif // FEATURE_ELEVATION_CONTROL - -#if defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - String row_0_string; // changed to static 2013-03-27 to see if it helps display stability / changed to global 2014-04-04 due to compile issues - unsigned long last_lcd_update = 0; - String last_row_0_string; // this is only used in update_display(), however if you make it a static within the funtion, the compiler errors out with a strange error -#endif // FEATURE_LCD_DISPLAY - - #if defined(FEATURE_LCD_DISPLAY) byte push_lcd_update = 0; #endif // FEATURE_LCD_DISPLAY @@ -908,6 +887,7 @@ byte current_az_speed_voltage = 0; #include "rotator_moon_and_sun.h" #include "rotator_ethernet.h" #include "rotator_stepper.h" +#include "rotator_language.h" /* ------------------ let's start doing some stuff now that we got the formalities out of the way --------------------*/ @@ -1833,10 +1813,6 @@ void check_preset_encoders(){ last_encoder_change_time = millis(); // Encoder Check Timer - #if defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - push_lcd_update = 1; // push an LCD update - #endif // FEATURE_LCD_DISPLAY - if (preset_encoders_state == ENCODER_IDLE) { preset_encoders_state = ENCODER_AZ_PENDING; } else { @@ -1904,10 +1880,6 @@ void check_preset_encoders(){ } last_encoder_change_time = millis(); // Encoder Check Timer - #if defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - last_lcd_update = 0; // push an LCD update - #endif // FEATURE_LCD_DISPLAY - if (preset_encoders_state == ENCODER_IDLE) { preset_encoders_state = ENCODER_EL_PENDING; } else { @@ -3145,7 +3117,7 @@ char * azimuth_direction(int azimuth_in){ #endif /* ifdef FEATURE_LCD_DISPLAY */ // -------------------------------------------------------------- -#if defined(FEATURE_LCD_DISPLAY) && defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) // ********************** development version ***************** +#if defined(FEATURE_LCD_DISPLAY) void update_display(){ @@ -3844,1134 +3816,8 @@ void update_display(){ } -#endif // defined(FEATURE_LCD_DISPLAY) && defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) -// -------------------------------------------------------------- -#if defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) // ******************* old version ********************* -void update_display(){ +#endif // defined(FEATURE_LCD_DISPLAY) - // update the LCD display - - static byte lcd_state_row_0 = 0; - static byte lcd_state_row_1 = 0; - - - - static int last_azimuth = -1; - - static char workstring[10] = ""; // changed to static 2013-03-27 to see if it helps display stability - - unsigned int target = 0; - - #ifdef FEATURE_ELEVATION_CONTROL - static int last_elevation = -1; - static int last_target_elevation = 0; - static byte last_el_state = 999; - #endif - - byte decimal_places = 0; - static byte last_az_state = 999; - - - if ((lcd_state_row_0 == 0) && (lcd_state_row_1 == 0)){ - if (millis() < SPLASH_SCREEN_TIME){ - return; - } else { - lcd.clear(); - lcd_state_row_0 = LCD_IDLE_STATUS; - } - } - - - // row 0 ------------------------------------------------------------ - - #ifndef FEATURE_ELEVATION_CONTROL - if (((millis() - last_lcd_update) > LCD_UPDATE_TIME) || (push_lcd_update) || (az_state != last_az_state)) { - #else - if (((millis() - last_lcd_update) > LCD_UPDATE_TIME) || (push_lcd_update) || (az_state != last_el_state) || (el_state != last_el_state)) { - #endif - - #ifndef FEATURE_ELEVATION_CONTROL - #ifdef FEATURE_AZ_PRESET_ENCODER - target = az_encoder_raw_degrees; - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - - if (preset_encoders_state == ENCODER_AZ_PENDING) { - clear_display_row(0); // Show Target Deg on upper line - row_0_string = TARGET_STRING; - dtostrf(target / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - - lcd_state_row_0 = LCD_TARGET_AZ; - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - - } else { - #endif // FEATURE_AZ_PRESET_ENCODER - - if ((last_az_state != az_state) || (last_azimuth != azimuth)){ - if (az_state != IDLE) { - if (az_request_queue_state == IN_PROGRESS_TO_TARGET) { - clear_display_row(0); - row_0_string = ROTATING_TO_STRING; - dtostrf(target_azimuth / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - // row_0_string.concat(int(target_azimuth / LCD_HEADING_MULTIPLIER)); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_TO; - - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - - } else { - - if ((az_state == SLOW_START_CW) || (az_state == NORMAL_CW) || (az_state == SLOW_DOWN_CW) || (az_state == TIMED_SLOW_DOWN_CW)) { - if (lcd_state_row_0 != LCD_ROTATING_CW) { - clear_display_row(0); - row_0_string = ROTATING_CW_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_CW; - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - } - } else { - if (lcd_state_row_0 != LCD_ROTATING_CCW) { - clear_display_row(0); - row_0_string = ROTATING_CCW_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_CCW; - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - } - } - } - } else { // az_state == IDLE - - - #ifndef FEATURE_PARK // --------- - if ((last_azimuth != azimuth) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - row_0_string.concat(idle_status()); - if ((last_row_0_string == row_0_string) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - clear_display_row(0); - lcd_state_row_0 = LCD_IDLE_STATUS; - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } else { - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2) - 1, 0); - lcd.print(" "); - lcd.print(row_0_string); - lcd.print(" "); - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } - } - - #else // FEATURE_PARK----------- - - if (park_status == PARKED) { - if (lcd_state_row_0 != LCD_PARKED) { - row_0_string = PARKED_STRING; - clear_display_row(0); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_PARKED; - } - - } else { - if ((last_azimuth != azimuth) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - row_0_string.concat(idle_status()); - if ((last_row_0_string == row_0_string) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - clear_display_row(0); - lcd_state_row_0 = LCD_IDLE_STATUS; - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } else { - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2) - 1, 0); - lcd.print(" "); - lcd.print(row_0_string); - lcd.print(" "); - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } - } - } - #endif // FEATURE_PARK --------- - - - - - - } // (az_state != IDLE) - }//<--- - #ifdef FEATURE_AZ_PRESET_ENCODER - } // (preset_encoders_state == ENCODER_AZ_PENDING) - #endif // FEATURE_AZ_PRESET_ENCODER - #endif /* ifndef FEATURE_ELEVATION_CONTROL */ - - // ------------ AZ & EL ----------------------------------------------- - - #ifdef FEATURE_ELEVATION_CONTROL - - #ifdef FEATURE_AZ_PRESET_ENCODER - #ifndef FEATURE_EL_PRESET_ENCODER - - unsigned int target = az_encoder_raw_degrees; - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - - if (preset_encoders_state == ENCODER_AZ_PENDING) { - clear_display_row(0); // Show Target Deg on upper line - row_0_string = TARGET_STRING; - dtostrf(target / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - - lcd_state_row_0 = LCD_TARGET_AZ; - #ifdef DEBUG_DISPLAY - if (debug_mode) { - control_port->print(F("update_display: ")); - control_port->println(row_0_string); - } - #endif // DEBUG_DISPLAY - - } else { - - #endif // ndef FEATURE_EL_PRESET_ENCODER - #endif // FEATURE_AZ_PRESET_ENCODER - - - #ifdef FEATURE_EL_PRESET_ENCODER - unsigned int target = az_encoder_raw_degrees; - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - if (target > (359 * LCD_HEADING_MULTIPLIER)) { - target = target - (360 * LCD_HEADING_MULTIPLIER); - } - - if (preset_encoders_state != ENCODER_IDLE) { - switch (preset_encoders_state) { - case ENCODER_AZ_PENDING: - clear_display_row(0); // Show Target Deg on upper line - row_0_string = AZ_TARGET_STRING; - dtostrf(target / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_TARGET_AZ; - break; - case ENCODER_EL_PENDING: - clear_display_row(0); // Show Target Deg on upper line - row_0_string = EL_TARGET_STRING; - dtostrf(el_encoder_degrees / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_TARGET_EL; - break; - case ENCODER_AZ_EL_PENDING: - clear_display_row(0); // Show Target Deg on upper line - row_0_string = TARGET_STRING; - dtostrf(target / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - dtostrf(el_encoder_degrees / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(" "); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_TARGET_AZ_EL; - break; - } /* switch */ - } else { // (preset_encoders_state != ENCODER_IDLE) - #endif // FEATURE_EL_PRESET_ENCODER - - - if ((az_state != last_az_state) || (el_state != last_el_state) || push_lcd_update || (last_azimuth != azimuth)){ - - if ((az_state != IDLE) && (el_state == IDLE)) { - if (az_request_queue_state == IN_PROGRESS_TO_TARGET) { - clear_display_row(0); - row_0_string = ROTATING_TO_STRING; - dtostrf(target_azimuth / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_TO; - } else { - if ((az_state == SLOW_START_CW) || (az_state == NORMAL_CW) || (az_state == SLOW_DOWN_CW) || (az_state == TIMED_SLOW_DOWN_CW)) { - clear_display_row(0); - row_0_string = ROTATING_CW_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_CW; - } else { - clear_display_row(0); - row_0_string = ROTATING_CCW_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ROTATING_CCW; - } - } - } // ((az_state != IDLE) && (el_state == IDLE)) - - if ((az_state == IDLE) && (el_state != IDLE)) { - // if ((el_request_queue_state == IN_PROGRESS_TO_TARGET) && ((lcd_state_row_0 != LCD_ELEVATING_TO) || (target_elevation != last_target_elevation))){ - if (el_request_queue_state == IN_PROGRESS_TO_TARGET) { - if ((lcd_state_row_0 != LCD_ELEVATING_TO) || (target_elevation != last_target_elevation)) { - clear_display_row(0); - row_0_string = ELEVATING_TO_STRING; - dtostrf(target_elevation / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ELEVATING_TO; - } - } else { - if (((el_state == SLOW_START_UP) || (el_state == NORMAL_UP) || (el_state == SLOW_DOWN_UP) || (el_state == TIMED_SLOW_DOWN_UP)) && (lcd_state_row_0 != LCD_ELEVATING_UP)) { - clear_display_row(0); - row_0_string = ELEVATING_UP_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ELEVATING_UP; - } - if (((el_state == SLOW_START_DOWN) || (el_state == NORMAL_DOWN) || (el_state == SLOW_DOWN_DOWN) || (el_state == TIMED_SLOW_DOWN_DOWN)) && (lcd_state_row_0 != LCD_ELEVATING_DOWN)) { - clear_display_row(0); - row_0_string = ELEVATING_DOWN_STRING; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_ELEVATING_DOWN; - } - } - } // ((az_state == IDLE) && (el_state != IDLE)) - - if ((az_state != IDLE) && (el_state != IDLE) && (lcd_state_row_0 != LCD_ROTATING_AZ_EL)) { - clear_display_row(0); - row_0_string = ROTATING_STRING; - if (az_request_queue_state == NONE) { - if (current_az_state() == ROTATING_CW) { - row_0_string.concat(CW_STRING); - } else { - row_0_string.concat(CCW_STRING); - } - } else { - //row_0_string.concat(int(target_azimuth / LCD_HEADING_MULTIPLIER)); - if ((target_azimuth / LCD_HEADING_MULTIPLIER) < 100){decimal_places = LCD_DECIMAL_PLACES;} else {decimal_places = 0;} - dtostrf(target_azimuth / LCD_HEADING_MULTIPLIER, 1, decimal_places, workstring); - row_0_string.concat(workstring); - } - row_0_string.concat(" "); - if (el_request_queue_state == NONE) { - if (current_el_state() == ROTATING_UP) { - row_0_string.concat(UP_STRING); - } else { - row_0_string.concat(DOWN_STRING); - } - } else { - if ((target_elevation / LCD_HEADING_MULTIPLIER) < 100){decimal_places = LCD_DECIMAL_PLACES;} else {decimal_places = 0;} - dtostrf(target_elevation / LCD_HEADING_MULTIPLIER, 1, decimal_places, workstring); - row_0_string.concat(workstring); - } - lcd_state_row_0 = LCD_ROTATING_AZ_EL; - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - } // ((az_state != IDLE) && (el_state != IDLE)) - - if ((az_state == IDLE) && (el_state == IDLE)) { - - #ifndef FEATURE_PARK - if ((last_azimuth != azimuth) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - row_0_string.concat(idle_status()); - if ((last_row_0_string != row_0_string) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - clear_display_row(0); - lcd_state_row_0 = LCD_IDLE_STATUS; - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } else { - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2) - 1, 0); - lcd.print(" "); - lcd.print(row_0_string); - lcd.print(" "); - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } - } - #else // FEATURE_PARK - - - if (park_status == PARKED) { - if (lcd_state_row_0 != LCD_PARKED) { - row_0_string = PARKED_STRING; - clear_display_row(0); - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - lcd_state_row_0 = LCD_PARKED; - } - } else { - if ((last_azimuth != azimuth) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - row_0_string.concat(idle_status()); - if ((last_row_0_string == row_0_string) || (lcd_state_row_0 != LCD_IDLE_STATUS)) { - clear_display_row(0); - lcd_state_row_0 = LCD_IDLE_STATUS; - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 0); - lcd.print(row_0_string); - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } else { - #ifdef OPTION_DISPLAY_DIRECTION_STATUS - lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2) - 1, 0); - lcd.print(" "); - lcd.print(row_0_string); - lcd.print(" "); - #endif //OPTION_DISPLAY_DIRECTION_STATUS - } - } - } - #endif // FEATURE_PARK - - - } // ((az_state == IDLE) && (el_state == IDLE)) - - #ifdef FEATURE_EL_PRESET_ENCODER - } // (preset_encoders_state != ENCODER_IDLE) - #endif // FEATURE_EL_PRESET_ENCODER - - - - #ifdef FEATURE_AZ_PRESET_ENCODER - #ifndef FEATURE_EL_PRESET_ENCODER - } - #endif // ndef FEATURE_EL_PRESET_ENCODER - #endif // FEATURE_AZ_PRESET_ENCODER - - } //<-- - - #endif // FEATURE_ELEVATION_CONTROL - - - - push_lcd_update = 0; - last_az_state = az_state; - #ifdef FEATURE_ELEVATION_CONTROL - last_el_state = el_state; - #endif // FEATURE_ELEVATION_CONTROL - - } - - - // row 1 -------------------------------------------- - - - if ((millis() - last_lcd_update) > LCD_UPDATE_TIME) { - #ifndef FEATURE_ELEVATION_CONTROL // ---------------- az only ----------------------------------- - if (last_azimuth != azimuth) { - //clear_display_row(1); - row_0_string = AZIMUTH_STRING; - dtostrf(azimuth / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - row_0_string.concat(char(223)); - //lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 1); - lcd.setCursor(0,1); - int x = LCD_COLUMNS - row_0_string.length(); - byte y = 0; - while (x > 0){ - if ((y%2) != 0){ - row_0_string = " " + row_0_string; - } else { - row_0_string.concat(" "); - } - y++; - x--; - } - lcd.print(row_0_string); - last_azimuth = azimuth; - lcd_state_row_1 = LCD_HEADING; - } - #endif // FEATURE_ELEVATION_CONTROL--------------------------------------------------------------- - - - - - #ifdef FEATURE_ELEVATION_CONTROL // --------------------az & el--------------------------------- - if ((last_azimuth != azimuth) || (last_elevation != elevation)) { - //clear_display_row(1); - #if defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) || defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - if ((azimuth >= 1000) && (elevation >= 1000)) { - row_0_string = AZ_STRING; - } else { - row_0_string = AZ_SPACE_STRING; - } - #else - row_0_string = AZ_SPACE_STRING; - #endif // efined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) || defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - dtostrf(azimuth/ LCD_HEADING_MULTIPLIER, 3, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - - #if !defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) && !defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - if (LCD_COLUMNS > 14) { - row_0_string.concat(char(223)); - } - #else - if ((LCD_COLUMNS > 18) || ((azimuth < 100) && (elevation < 100))) { - row_0_string.concat(char(223)); - } - #endif - - #if defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) || defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - if ((elevation >= 1000) && (azimuth >= 1000)) { - row_0_string.concat(SPACE_EL_STRING); - } else { - row_0_string.concat(SPACE_EL_SPACE_STRING); - } - #else - row_0_string.concat(SPACE_EL_SPACE_STRING); - #endif // defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) || defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - - dtostrf(elevation / LCD_HEADING_MULTIPLIER, 1, LCD_DECIMAL_PLACES, workstring); - row_0_string.concat(workstring); - - #if !defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) && !defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) - if (LCD_COLUMNS > 14) { - row_0_string.concat(char(223)); - } - #else - if ((LCD_COLUMNS > 18) || ((azimuth < 100) && (elevation < 100))) { - row_0_string.concat(char(223)); - } - #endif - - lcd.setCursor(0,1); - int x = LCD_COLUMNS - row_0_string.length(); - byte y = 0; - while (x > 0){ - if ((y%2) != 0){ - row_0_string = " " + row_0_string; - } else { - row_0_string.concat(" "); - } - y++; - x--; - } - //lcd.setCursor(((LCD_COLUMNS - row_0_string.length()) / 2), 1); - lcd.print(row_0_string); - - last_azimuth = azimuth; - last_elevation = elevation; - lcd_state_row_1 = LCD_HEADING; - } - #endif // FEATURE_ELEVATION_CONTROL //------------------------------------------------------------ - - - - } - - - char temp_string[10] = ""; - - #if defined(OPTION_DISPLAY_HHMMSS_CLOCK) || defined(OPTION_DISPLAY_HHMM_CLOCK) || defined(OPTION_DISPLAY_ALT_HHMM_CLOCK_AND_MAIDENHEAD) || defined(OPTION_DISPLAY_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD) - char clock_temp_string[16] = ""; - #endif - - - // clock display -- small ---------------------------------------------------------- - #if defined(OPTION_DISPLAY_HHMMSS_CLOCK) && defined(FEATURE_CLOCK) - - - static byte last_clock_seconds = 0; - static byte last_clock_lcd_row_state = 0; - byte clock_digits = 0; - - - update_time(); - if (((last_clock_seconds != clock_seconds) || (last_clock_lcd_row_state != LCD_IDLE_STATUS)) && (lcd_state_row_0 == LCD_IDLE_STATUS)){ - #ifdef OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - if (clock_hours < 10) { - strcat(clock_temp_string, "0"); - } - dtostrf(clock_hours, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - #else - dtostrf(clock_hours, 0, 0, temp_string); - strcpy(clock_temp_string,temp_string); - #endif //OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - strcat(clock_temp_string,":"); - if (clock_minutes < 10) { - strcat(clock_temp_string, "0"); - } - if (clock_hours > 9){ - clock_digits = 1; - } - dtostrf(clock_minutes, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - strcat(clock_temp_string,":"); - if (clock_seconds < 10) { - strcat(clock_temp_string, "0"); - } - dtostrf(clock_seconds, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - if (LCD_HHMMSS_CLOCK_POSITION == LEFT){ - lcd.setCursor(0,0); - } else { - lcd.setCursor(LCD_COLUMNS-(7+clock_digits),0); - } - lcd.print(clock_temp_string); - if ((clock_minutes == 0) && (clock_hours == 0)) { - if (LCD_HHMMSS_CLOCK_POSITION == RIGHT){ - lcd.setCursor(LCD_COLUMNS-(9+clock_digits),0); - } - lcd.print(" "); - } - last_clock_seconds = clock_seconds; - - } - last_clock_lcd_row_state = lcd_state_row_0; - #endif //defined(OPTION_DISPLAY_HHMMSS_CLOCK) && defined(FEATURE_CLOCK) - - - - // clock display -- small ---------------------------------------------------------- - #if defined(OPTION_DISPLAY_HHMM_CLOCK) && defined(FEATURE_CLOCK) - - - //clock_temp_string = ""; - static byte last_clock_minutes = 0; - static byte last_clock_lcd_row_state = 0; - byte clock_digits = 0; - - - update_time(); - if (((last_clock_minutes != clock_minutes) || (last_clock_lcd_row_state != LCD_IDLE_STATUS)) && (lcd_state_row_0 == LCD_IDLE_STATUS)){ - #ifdef OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - if (clock_hours < 10) { - strcat(clock_temp_string, "0"); - } - dtostrf(clock_hours, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - #else - dtostrf(clock_hours, 0, 0, temp_string); - strcpy(clock_temp_string,temp_string); - #endif //OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - strcat(clock_temp_string,":"); - if (clock_minutes < 10) { - strcat(clock_temp_string, "0"); - } - if (clock_hours > 9){ - clock_digits = 1; - } - dtostrf(clock_minutes, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - if (LCD_HHMM_CLOCK_POSITION == LEFT){ - lcd.setCursor(0,0); - } else { - lcd.setCursor(LCD_COLUMNS-(4+clock_digits),0); - } - lcd.print(clock_temp_string); - if ((clock_minutes == 0) && (clock_hours == 0)) { - if (LCD_HHMM_CLOCK_POSITION == RIGHT){ - lcd.setCursor(LCD_COLUMNS-(6+clock_digits),0); - } - lcd.print(" "); - } - last_clock_minutes = clock_minutes; - - } - last_clock_lcd_row_state = lcd_state_row_0; - #endif //defined(OPTION_DISPLAY_HHMM_CLOCK) && defined(FEATURE_CLOCK) - - -// alternating H:MM clock and maidenhead display ------------------------------------------------------------ - #if defined(OPTION_DISPLAY_ALT_HHMM_CLOCK_AND_MAIDENHEAD) && defined(FEATURE_CLOCK) - - - //clock_temp_string = ""; - static byte last_clock_minutes = 0; - static byte last_clock_seconds = 0; - static byte last_clock_lcd_row_state = 0; - byte clock_digits = 0; - static byte displaying_clock = 1; - - - if ((lcd_state_row_0 != LCD_UNDEF) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1)!= 0))){ - update_time(); - - if (((last_clock_seconds != clock_seconds) || ((((LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1)== 0))) && (last_clock_lcd_row_state != LCD_IDLE_STATUS)) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1)!= 0))){ - if (((clock_seconds % 5) == 0) || (((LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1)== 0) && (last_clock_lcd_row_state != LCD_IDLE_STATUS))) { - if (displaying_clock){ - if (LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION == LEFT){ - lcd.setCursor(0,LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1); - } else { - lcd.setCursor(LCD_COLUMNS-6,LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1); - } - lcd.print(coordinates_to_maidenhead(latitude,longitude)); - displaying_clock = 0; - } else { - displaying_clock = 2; // switch to the clock (2 == print the clock regardless of time) - } - - } - last_clock_seconds = clock_seconds; - } - - - if (((displaying_clock && (last_clock_minutes != clock_minutes)) || (displaying_clock == 2)) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1)!= 0))){ - #ifdef OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - if (clock_hours < 10) { - strcpy(clock_temp_string, "0"); - } - dtostrf(clock_hours, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - #else - dtostrf(clock_hours, 0, 0, temp_string); - strcpy(clock_temp_string,temp_string); - #endif //OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - strcat(clock_temp_string,":"); - if (clock_minutes < 10) { - strcat(clock_temp_string, "0"); - } - if (clock_hours > 9){ - clock_digits = 1; - } - dtostrf(clock_minutes, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - if (LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION == LEFT){ - lcd.setCursor(0,LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1); - } else { - lcd.setCursor(LCD_COLUMNS-(4+clock_digits),LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1); - } - lcd.print(clock_temp_string); - if (LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION == RIGHT){ - lcd.setCursor(LCD_COLUMNS-(6+clock_digits),LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW-1); - } - lcd.print(" "); - last_clock_minutes = clock_minutes; - displaying_clock = 1; - } - last_clock_lcd_row_state = lcd_state_row_0; - } - #endif //defined(OPTION_DISPLAY_ALT_HHMM_CLOCK_AND_MAIDENHEAD) && defined(FEATURE_CLOCK) - - // constant HH:MM:SS clock and maidenhead display ---------------------------------------------------------- - #if defined(OPTION_DISPLAY_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD) && defined(FEATURE_CLOCK) - - - //clock_temp_string = ""; - static byte last_clock_minutes = 0; - static byte last_clock_seconds = 0; - static byte last_clock_lcd_row_state = 0; - byte clock_digits = 0; - - - if ((lcd_state_row_0 != LCD_UNDEF) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW-1)!= 0))){ - update_time(); - - if (((last_clock_seconds != clock_seconds) || ((((LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW-1)== 0))) && (last_clock_lcd_row_state != LCD_IDLE_STATUS)) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW-1)!= 0))){ - if (LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_POSITION == LEFT){ - lcd.setCursor(0,LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW-1); - } else { - lcd.setCursor(LCD_COLUMNS-14,LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW-1); - } - #ifdef OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - if (clock_hours < 10) { - strcpy(clock_temp_string, "0"); - } - dtostrf(clock_hours, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - #else - dtostrf(clock_hours, 0, 0, temp_string); - strcpy(clock_temp_string,temp_string); - #endif //OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO - strcat(clock_temp_string,":"); - if (clock_minutes < 10) { - strcat(clock_temp_string, "0"); - } - if (clock_hours > 9){ - clock_digits = 1; - } - dtostrf(clock_minutes, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - strcat(clock_temp_string,":"); - if (clock_seconds < 10) { - strcat(clock_temp_string, "0"); - } - dtostrf(clock_seconds, 0, 0, temp_string); - strcat(clock_temp_string,temp_string); - lcd.print(clock_temp_string); - lcd.print(" "); - lcd.print(coordinates_to_maidenhead(latitude,longitude)); - last_clock_seconds = clock_seconds; - } - - - last_clock_lcd_row_state = lcd_state_row_0; - } - #endif //defined(OPTION_DISPLAY_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD) && defined(FEATURE_CLOCK) - - // gps indicator ------------------------------------------------------------------------- - #if defined(OPTION_DISPLAY_GPS_INDICATOR) && defined(FEATURE_GPS) && defined(FEATURE_CLOCK) - static byte last_clock_status = FREE_RUNNING; - static byte last_gps_lcd_row_state = 0; - - if ((lcd_state_row_0 != LCD_UNDEF) && ((lcd_state_row_0 == LCD_IDLE_STATUS) || ((LCD_GPS_INDICATOR_ROW-1)!= 0))){ - if ((last_clock_status != clock_status) || ((LCD_GPS_INDICATOR_ROW == 1) && (last_gps_lcd_row_state != lcd_state_row_0))) { - if (LCD_GPS_INDICATOR_POSITION == LEFT){ - lcd.setCursor(0,LCD_GPS_INDICATOR_ROW-1); - } else { - lcd.setCursor(LCD_COLUMNS-3,LCD_GPS_INDICATOR_ROW-1); - } - if ((clock_status == GPS_SYNC) || (clock_status == SLAVE_SYNC_GPS)){ - lcd.print(GPS_STRING); - } else { - lcd.print(" "); - } - } - last_clock_status = clock_status; - } - last_gps_lcd_row_state = lcd_state_row_0; - #endif //defined(OPTION_DISPLAY_GPS_INDICATOR) && defined(FEATURE_GPS) && defined(FEATURE_CLOCK) - - - - - #if (defined(OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY) && defined(FEATURE_MOON_TRACKING)) || (defined(OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY) && defined(FEATURE_SUN_TRACKING)) || defined(OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL) - char trackingstring[LCD_COLUMNS+2] = ""; - char temptrackingstring[LCD_COLUMNS+2] = ""; - #endif - - // moon tracking ---------------------------------------------------------- - #if defined(OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY) && defined(FEATURE_MOON_TRACKING) - - static unsigned long last_moon_tracking_check_time = 0; - static byte last_strlen_moon = 0; - - if ((lcd_state_row_0 != 0) && (lcd_state_row_1 != 0) && ((millis()-last_moon_tracking_check_time) > LCD_MOON_TRACKING_UPDATE_INTERVAL)) { - update_moon_position(); - strcpy(trackingstring,""); - if (moon_tracking_active){ - if (moon_visible){ - strcat(trackingstring,TRACKING_ACTIVE_CHAR); - } else { - strcat(trackingstring,"-"); - } - } - strcat(trackingstring,MOON_STRING); - dtostrf(moon_azimuth,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((moon_azimuth < 100) || (abs(moon_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - strcat(trackingstring," "); - dtostrf(moon_elevation,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((moon_azimuth < 100) || (abs(moon_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - if (moon_tracking_active){ - if (moon_visible){ - strcat(trackingstring,TRACKING_ACTIVE_CHAR); - } else { - strcat(trackingstring,TRACKING_INACTIVE_CHAR); - } - } - // if (strlen(trackingstring) < last_strlen_moon){ - // clear_display_row(LCD_MOON_TRACKING_ROW-1); - // } - // last_strlen_moon = strlen(trackingstring); - // lcd.setCursor((LCD_COLUMNS-strlen(trackingstring))/2,LCD_MOON_TRACKING_ROW-1); - - lcd.setCursor(0,LCD_MOON_TRACKING_ROW-1); - int x = LCD_COLUMNS - strlen(trackingstring); - byte y = 0; - while (x > 0){ - if ((y%2) != 0){ - strcpy(temptrackingstring," "); - strcat(temptrackingstring,trackingstring); - strcpy(trackingstring,temptrackingstring); - } else { - strcat(trackingstring," "); - } - y++; - x--; - } - - - - lcd.print(trackingstring); - last_moon_tracking_check_time = millis(); - } - #endif //defined(OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY) && defined(FEATURE_MOON_TRACKING) - - - // sun tracking ---------------------------------------------------------- - #if defined(OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY) && defined(FEATURE_SUN_TRACKING) - - static unsigned long last_sun_tracking_check_time = 0; - static byte last_strlen_sun = 0; - - if ((lcd_state_row_0 != 0) && (lcd_state_row_1 != 0) && ((millis()-last_sun_tracking_check_time) > LCD_SUN_TRACKING_UPDATE_INTERVAL)) { - update_sun_position(); - strcpy(trackingstring,""); - if (sun_tracking_active){ - if (sun_visible){ - strcat(trackingstring,TRACKING_ACTIVE_CHAR); - } else { - strcat(trackingstring,TRACKING_INACTIVE_CHAR); - } - } - strcat(trackingstring,SUN_STRING); - dtostrf(sun_azimuth,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((sun_azimuth < 100) || (abs(sun_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - strcat(trackingstring," "); - dtostrf(sun_elevation,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((sun_azimuth < 100) || (abs(sun_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - if (sun_tracking_active){ - if (sun_visible){ - strcat(trackingstring,TRACKING_ACTIVE_CHAR); - } else { - strcat(trackingstring,TRACKING_INACTIVE_CHAR); - } - } - // if (strlen(trackingstring) < last_strlen_sun){ - // clear_display_row(LCD_SUN_TRACKING_ROW-1); - // } - // last_strlen_sun = strlen(trackingstring); - // lcd.setCursor((LCD_COLUMNS-strlen(trackingstring))/2,LCD_SUN_TRACKING_ROW-1); - - lcd.setCursor(0,LCD_SUN_TRACKING_ROW-1); - int x = LCD_COLUMNS - strlen(trackingstring); - byte y = 0; - while (x > 0){ - if ((y%2) != 0){ - strcpy(temptrackingstring," "); - strcat(temptrackingstring,trackingstring); - strcpy(trackingstring,temptrackingstring); - } else { - strcat(trackingstring," "); - } - y++; - x--; - } - - - - lcd.print(trackingstring); - last_sun_tracking_check_time = millis(); - } - #endif //defined(OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY) && defined(FEATURE_SUN_TRACKING) - - - - - - - // moon and/or sun tracking conditional ------------------------------------------------------------------------ - #ifdef OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL - - // moon tracking ---- - #if defined(FEATURE_MOON_TRACKING) - - static unsigned long last_moon_tracking_check_time = 0; - static byte last_strlen_moon = 0; - static byte last_moon_tracking_state = 0; - - if ((lcd_state_row_0 != 0) && (lcd_state_row_1 != 0) && ((millis()-last_moon_tracking_check_time) > LCD_MOON_TRACKING_UPDATE_INTERVAL) && moon_tracking_active) { - update_moon_position(); - strcpy(trackingstring,""); - strcat(trackingstring,MOON_STRING); - dtostrf(moon_azimuth,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((moon_azimuth < 100) || (abs(moon_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - strcat(trackingstring," "); - dtostrf(moon_elevation,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((moon_azimuth < 100) || (abs(moon_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - if (strlen(trackingstring) < last_strlen_moon){ - clear_display_row(LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - } - last_strlen_moon = strlen(trackingstring); - lcd.setCursor((LCD_COLUMNS-strlen(trackingstring))/2,LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - lcd.print(trackingstring); - last_moon_tracking_check_time = millis(); - last_moon_tracking_state = 1; - } - - if (!moon_tracking_active && last_moon_tracking_state){ - clear_display_row(LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - last_moon_tracking_state = 0; - } - - #endif //defined(OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY) && defined(FEATURE_MOON_TRACKING) - - - // sun tracking ---------------------------------------------------------- - #if defined(FEATURE_SUN_TRACKING) - - static unsigned long last_sun_tracking_check_time = 0; - static byte last_strlen_sun = 0; - static byte last_sun_tracking_state = 0; - - if ((lcd_state_row_0 != 0) && (lcd_state_row_1 != 0) && ((millis()-last_sun_tracking_check_time) > LCD_SUN_TRACKING_UPDATE_INTERVAL) && sun_tracking_active) { - update_sun_position(); - strcpy(trackingstring,""); - strcat(trackingstring,SUN_STRING); - dtostrf(sun_azimuth,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((sun_azimuth < 100) || (abs(sun_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - strcat(trackingstring," "); - dtostrf(sun_elevation,0,LCD_DECIMAL_PLACES,temp_string); - strcat(trackingstring,temp_string); - if ((LCD_COLUMNS>16) && ((sun_azimuth < 100) || (abs(sun_elevation)<100))) {strcat(trackingstring,DISPLAY_DEGREES_STRING);} - if (strlen(trackingstring) < last_strlen_sun){ - clear_display_row(LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - } - last_strlen_sun = strlen(trackingstring); - lcd.setCursor((LCD_COLUMNS-strlen(trackingstring))/2,LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - lcd.print(trackingstring); - last_sun_tracking_check_time = millis(); - last_sun_tracking_state = 1; - } - - - if (!sun_tracking_active && last_sun_tracking_state){ - clear_display_row(LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW-1); - last_sun_tracking_state = 0; - } - - #endif //defined(FEATURE_SUN_TRACKING) - - #endif //OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL - - // end of moon and/or sun conditional ----- - - if ((millis() - last_lcd_update) > LCD_UPDATE_TIME) { - last_lcd_update = millis(); - } - - last_row_0_string = row_0_string; - - - - - - - // clock display --- big clock --------------------------------------------------------- - /* this is outside the normal LCD refresh timing so the seconds update as soon as possible */ - #if defined(OPTION_DISPLAY_BIG_CLOCK) && defined(FEATURE_CLOCK) - - char clock_big_temp_string[22] = ""; - static byte last_clock_big_seconds = 0; - static byte last_clock_big_minutes = 0; - static byte printed_z = 0; - - - update_time(); - if ((last_clock_big_seconds != clock_seconds) && (lcd_state_row_0 != 0) && (lcd_state_row_1 != 0)){ - sprintf(clock_big_temp_string, "%s", clock_string()); - //clock_big_temp_string[20] - if (last_clock_big_minutes == clock_minutes){ // if the minutes didn't change, don't send the whole string to the LCD - - if ((int(float(last_clock_big_seconds)/10.0)) != (int(float(clock_seconds)/10.0))){ - lcd.setCursor(((LCD_COLUMNS-20)/2)+17,LCD_BIG_CLOCK_ROW-1); - lcd.print(clock_big_temp_string[17]); - } else { - lcd.setCursor(((LCD_COLUMNS-20)/2)+18,LCD_BIG_CLOCK_ROW-1); - } - lcd.print(clock_big_temp_string[18]); - last_clock_big_seconds = clock_seconds; - - - - } else { // print the whole clock - lcd.setCursor((LCD_COLUMNS-20)/2,LCD_BIG_CLOCK_ROW-1); - if (!printed_z){clock_big_temp_string[20] = 0;} // I put this in to fix mysterious characters that appear at 0,0 for no reason - lcd.print(clock_big_temp_string); - last_clock_big_seconds = clock_seconds; - last_clock_big_minutes = clock_minutes; - printed_z = 1; - } - } - #endif //defined(OPTION_DISPLAY_BIG_CLOCK) && defined(FEATURE_CLOCK) - // end clock display --- big clock --------------------------------------------------------- - - - -} /* update_display */ -#endif // defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - - -// -------------------------------------------------------------- -#if defined(FEATURE_LCD_DISPLAY) && !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) -void clear_display_row(byte row_number){ - lcd.setCursor(0, row_number); - for (byte x = 0; x < LCD_COLUMNS; x++) { - lcd.print(" "); - } -} -#endif // -------------------------------------------------------------- #if defined(FEATURE_REMOTE_UNIT_SLAVE) || defined(FEATURE_YAESU_EMULATION) || defined(FEATURE_EASYCOM_EMULATION) @@ -7516,7 +6362,7 @@ void initialize_serial(){ // -------------------------------------------------------------- -#if defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) + void initialize_display(){ #if defined(FEATURE_LCD_DISPLAY) @@ -7547,60 +6393,7 @@ void initialize_display(){ } -#endif //defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) -// -------------------------------------------------------------- - -#if !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) -void initialize_display(){ - - - #if defined(FEATURE_LCD_DISPLAY) - - #ifdef DEBUG_LOOP - debug_print("initialize_display()\n"); - Serial.flush(); - #endif // DEBUG_LOOP - - byte start_row = 0; - - - lcd.begin(LCD_COLUMNS, LCD_ROWS); - - #ifdef FEATURE_YOURDUINO_I2C_LCD - lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); - lcd.setBacklight(I2C_LCD_COLOR); - #endif // FEATURE_YOURDUINO_I2C_LCD - - #ifdef FEATURE_ADAFRUIT_I2C_LCD - lcd.setBacklight(I2C_LCD_COLOR); - #endif // FEATURE_ADAFRUIT_I2C_LCD - - #ifdef OPTION_DISPLAY_VERSION_ON_STARTUP - if (LCD_ROWS == 4){start_row = 0;} - #else - if (LCD_ROWS == 4){start_row = 1;} - #endif - - lcd.setCursor(((LCD_COLUMNS - 4) / 2), start_row); - lcd.print("\x4B\x33\x4E\x47"); - lcd.setCursor(((LCD_COLUMNS - 16) / 2), start_row + 1); - lcd.print("\x52\x6F\x74\x6F\x72\x20\x43\x6F\x6E\x74\x72\x6F\x6C\x6C\x65\x72"); - #ifdef OPTION_DISPLAY_VERSION_ON_STARTUP //code provided by Paolo, IT9IPQ - if (LCD_ROWS == 4) { - lcd.setCursor(0, start_row + 3); - } - if (LCD_ROWS == 2) { - lcd.setCursor(0, 1); - } - lcd.print("Ver: "); lcd.print(CODE_VERSION); - #endif //OPTION_DISPLAY_VERSION_ON_STARTUP - last_lcd_update = millis(); - - #endif //defined(FEATURE_LCD_DISPLAY) - -} /* initialize_display */ -#endif // !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) // -------------------------------------------------------------- @@ -10478,7 +9271,7 @@ void submit_autocorrect(byte axis,float heading){ // -------------------------------------------------------------- -#if defined(FEATURE_REMOTE_UNIT_SLAVE) || defined(FEATURE_ANCILLARY_PIN_CONTROL) || defined(UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS) +//#if defined(FEATURE_REMOTE_UNIT_SLAVE) || defined(FEATURE_ANCILLARY_PIN_CONTROL) || defined(UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS) byte get_analog_pin(byte pin_number){ byte return_output = 0; @@ -10496,7 +9289,7 @@ byte get_analog_pin(byte pin_number){ return return_output; } -#endif // FEATURE_REMOTE_UNIT_SLAVE +//#endif // FEATURE_REMOTE_UNIT_SLAVE // *************************************** stuff below here has issues moving to .h files - need to work on this ********************** diff --git a/libraries/k3ngdisplay.cpp b/libraries/k3ngdisplay.cpp index 2749459..bc4915a 100755 --- a/libraries/k3ngdisplay.cpp +++ b/libraries/k3ngdisplay.cpp @@ -2,7 +2,7 @@ #ifndef K3NG_DISPLAY_H #define K3NG_DISPLAY_H -// K3NG_DISPLAY_LIBRARY_VERSION "1.0.2015071201" +// K3NG_DISPLAY_LIBRARY_VERSION "1.0.2015090401" #if defined(ARDUINO) && ARDUINO >= 100 @@ -80,8 +80,6 @@ unsigned long next_blink_state_transition_time = TEXT_BLINK_MS; //----------------------------------------------------------------------------------------------------- K3NGdisplay::K3NGdisplay(int _display_columns, int _display_rows, int _update_time = 1000){ - - display_columns = _display_columns; display_rows = _display_rows; diff --git a/libraries/k3ngdisplay.h b/libraries/k3ngdisplay.h index da6baf4..7ed9610 100755 --- a/libraries/k3ngdisplay.h +++ b/libraries/k3ngdisplay.h @@ -5,7 +5,7 @@ #include "WProgram.h" #endif - +#include "rotator_hardware.h" #ifdef HARDWARE_EA4TX_ARS_USB #include "rotator_features_ea4tx_ars_usb.h" @@ -30,7 +30,6 @@ #include "rotator_pins_m0upu.h" #endif #ifdef HARDWARE_WB6KCN - //#include "rotator_pins_wb6kcn_az_test_setup.h" #include "rotator_pins_wb6kcn.h" #endif #ifdef HARDWARE_TEST @@ -40,7 +39,7 @@ #include "rotator_pins.h" #endif -#define K3NG_DISPLAY_LIBRARY_VERSION "1.0.2015071201" +#define K3NG_DISPLAY_LIBRARY_VERSION "1.0.2015090401" #define MAX_SCREEN_BUFFER_COLUMNS 20 #define MAX_SCREEN_BUFFER_ROWS 4 diff --git a/rotator_command_processing.h b/rotator_command_processing.h index 9e59623..87d9e37 100644 --- a/rotator_command_processing.h +++ b/rotator_command_processing.h @@ -6,14 +6,14 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte static unsigned long serial_led_time = 0; float tempfloat = 0; - #ifdef UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS + #if !defined(OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS) float heading = 0; #endif - #if !defined(FEATURE_AZ_POSITION_ROTARY_ENCODER) && !defined(FEATURE_AZ_POSITION_PULSE_INPUT) + //#if !defined(FEATURE_AZ_POSITION_ROTARY_ENCODER) && !defined(FEATURE_AZ_POSITION_PULSE_INPUT) long place_multiplier = 0; byte decimalplace = 0; - #endif + //#endif #ifdef FEATURE_CLOCK int temp_year = 0; @@ -472,136 +472,207 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte // TODO : one big status query command (get rid of all these little commands) - #ifdef UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS + #if !defined(OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS) case '?': strcpy(return_string, "\\!??"); // \\??xxyy - failed response back if (input_buffer_index == 4){ - if ((input_buffer[2] == 'A') && (input_buffer[3] == 'Z')) { // \\AZ - query AZ + if ((input_buffer[2] == 'F') && (input_buffer[3] == 'S')) { // \?FS - Full Status + strcpy(return_string, "\\!OKFS"); + // AZ + if ((raw_azimuth/HEADING_MULTIPLIER) < 100) { + strcat(return_string,"0"); + } + if ((raw_azimuth/HEADING_MULTIPLIER) < 10) { + strcat(return_string,"0"); + } + dtostrf(float(raw_azimuth/(float)HEADING_MULTIPLIER),0,6,temp_string); + strcat(return_string,temp_string); + strcat(return_string,","); + // EL + #if defined(FEATURE_ELEVATION_CONTROL) + if ((elevation/HEADING_MULTIPLIER) >= 0) { + strcat(return_string,"+"); + } else { + strcat(return_string,"-"); + } + if (abs(elevation/HEADING_MULTIPLIER) < 100) { + strcat(return_string,"0"); + } + if (abs(elevation/HEADING_MULTIPLIER) < 10) { + strcat(return_string,"0"); + } + dtostrf(float(abs(elevation/(float)HEADING_MULTIPLIER)),0,6,temp_string); + strcat(return_string,temp_string); + #endif // FEATURE_ELEVATION_CONTROL + strcat(return_string,","); + // AS + dtostrf(az_state, 0, 0, temp_string); + strcat(return_string, temp_string); + strcat(return_string,","); + // ES + #if defined(FEATURE_ELEVATION_CONTROL) + dtostrf(el_state, 0, 0, temp_string); + strcat(return_string, temp_string); + #endif + strcat(return_string,","); + + // RC + #ifdef FEATURE_GPS + if (latitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} + dtostrf(abs(latitude),0,4,temp_string); + strcat(return_string,temp_string); + strcat(return_string,","); + if (longitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} + if (longitude < 100){strcat(return_string,"0");} + dtostrf(abs(longitude),0,4,temp_string); + strcat(return_string,temp_string); + #endif //FEATURE_GPS + strcat(return_string,","); + // GS + #ifdef FEATURE_CLOCK + if (clock_status == GPS_SYNC){ + strcat(return_string,"1"); + } else { + strcat(return_string,"0"); + } + #endif //FEATURE_CLOCK + strcat(return_string,","); + + #ifdef FEATURE_CLOCK + update_time(); + strcat(return_string,clock_string()); + #endif //FEATURE_CLOCK + + strcat(return_string,";"); + + + } + if ((input_buffer[2] == 'A') && (input_buffer[3] == 'Z')) { // \?AZ - query AZ strcpy(return_string, "\\!OKAZ"); if ((raw_azimuth/HEADING_MULTIPLIER) < 100) { strcat(return_string,"0"); + } + if ((raw_azimuth/HEADING_MULTIPLIER) < 10) { + strcat(return_string,"0"); + } + dtostrf(float(raw_azimuth/(float)HEADING_MULTIPLIER),0,6,temp_string); + strcat(return_string,temp_string); + } + if ((input_buffer[2] == 'E') && (input_buffer[3] == 'L')) { // \?EL - query EL + #ifdef FEATURE_ELEVATION_CONTROL + strcpy(return_string, "\\!OKEL"); + if ((elevation/HEADING_MULTIPLIER) >= 0) { + strcat(return_string,"+"); + } else { + strcat(return_string,"-"); } - if ((raw_azimuth/HEADING_MULTIPLIER) < 10) { + if (abs(elevation/HEADING_MULTIPLIER) < 100) { strcat(return_string,"0"); } - dtostrf(float(raw_azimuth/(float)HEADING_MULTIPLIER),0,6,temp_string); + if (abs(elevation/HEADING_MULTIPLIER) < 10) { + strcat(return_string,"0"); + } + dtostrf(float(abs(elevation/(float)HEADING_MULTIPLIER)),0,6,temp_string); + strcat(return_string,temp_string); + #else // FEATURE_ELEVATION_CONTROL + strcpy(return_string, "\\!??EL"); + #endif //FEATURE_ELEVATION_CONTROL + } + if ((input_buffer[2] == 'A') && (input_buffer[3] == 'S')) { // \?AS - AZ status + strcpy(return_string, "\\!OKAS"); + dtostrf(az_state, 0, 0, temp_string); + strcat(return_string, temp_string); + } + if ((input_buffer[2] == 'E') && (input_buffer[3] == 'S')) { // \?ES - EL Status + #ifdef FEATURE_ELEVATION_CONTROL + strcpy(return_string, "\\!OKES"); + dtostrf(el_state, 0, 0, temp_string); + strcat(return_string, temp_string); + #else // FEATURE_ELEVATION_CONTROL + strcpy(return_string, "\\!??ES"); + #endif //FEATURE_ELEVATION_CONTROL + } + if ((input_buffer[2] == 'P') && (input_buffer[3] == 'G')) { // \?PG - Ping + strcpy(return_string, "\\!OKPG"); + } + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'L')) { // \?RL - rotate left + submit_request(AZ, REQUEST_CCW, 0, 121); + strcpy(return_string, "\\!OKRL"); + } + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'R')) { // \?RR - rotate right + submit_request(AZ, REQUEST_CW, 0, 122); + strcpy(return_string, "\\!OKRR"); + } + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'U')) { // \?RU - elevate up + submit_request(EL, REQUEST_UP, 0, 129); + strcpy(return_string, "\\!OKRU"); + } + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'D')) { // \?RD - elevate down + submit_request(EL, REQUEST_DOWN, 0, 130); + strcpy(return_string, "\\!OKRD"); + } + #ifdef FEATURE_GPS + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'C')) { // \?RC - Read coordinates + strcpy(return_string,"\\!OKRC"); + if (latitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} + dtostrf(abs(latitude),0,4,temp_string); + strcat(return_string,temp_string); + strcat(return_string," "); + if (longitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} + if (longitude < 100){strcat(return_string,"0");} + dtostrf(abs(longitude),0,4,temp_string); strcat(return_string,temp_string); } - if ((input_buffer[2] == 'E') && (input_buffer[3] == 'L')) { // \\EL - query EL - #ifdef FEATURE_ELEVATION_CONTROL - strcpy(return_string, "\\!OKEL"); - if ((elevation/HEADING_MULTIPLIER) >= 0) { - strcat(return_string,"+"); - } else { - strcat(return_string,"-"); - } - if (abs(elevation/HEADING_MULTIPLIER) < 100) { - strcat(return_string,"0"); - } - if (abs(elevation/HEADING_MULTIPLIER) < 10) { - strcat(return_string,"0"); - } - dtostrf(float(abs(elevation/(float)HEADING_MULTIPLIER)),0,6,temp_string); - strcat(return_string,temp_string); - #else // FEATURE_ELEVATION_CONTROL - strcpy(return_string, "\\!??EL"); - #endif //FEATURE_ELEVATION_CONTROL + #endif //FEATURE_GPS + #ifdef FEATURE_CLOCK + if ((input_buffer[2] == 'G') && (input_buffer[3] == 'S')) { // \?GS - query GPS sync + strcpy(return_string,"\\!OKGS"); + if (clock_status == GPS_SYNC){ + strcat(return_string,"1"); + } else { + strcat(return_string,"0"); + } } - if ((input_buffer[2] == 'A') && (input_buffer[3] == 'S')) { // \\AS - AZ status - strcpy(return_string, "\\!OKAS"); - dtostrf(az_state, 0, 0, temp_string); - strcat(return_string, temp_string); - } - if ((input_buffer[2] == 'E') && (input_buffer[3] == 'S')) { // \\ES - EL Status - #ifdef FEATURE_ELEVATION_CONTROL - strcpy(return_string, "\\!OKES"); - dtostrf(el_state, 0, 0, temp_string); - strcat(return_string, temp_string); - #else // FEATURE_ELEVATION_CONTROL - strcpy(return_string, "\\!??ES"); - #endif //FEATURE_ELEVATION_CONTROL - } - if ((input_buffer[2] == 'P') && (input_buffer[3] == 'G')) { // \\PG - Ping - strcpy(return_string, "\\!OKPG"); - } - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'L')) { // \\RL - rotate left - submit_request(AZ, REQUEST_CCW, 0, 121); - strcpy(return_string, "\\!OKRL"); - } - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'R')) { // \\RR - rotate right - submit_request(AZ, REQUEST_CW, 0, 122); - strcpy(return_string, "\\!OKRL"); - } - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'U')) { // \\RU - elevate up - submit_request(EL, REQUEST_UP, 0, 129); - strcpy(return_string, "\\!OKRU"); - } - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'D')) { // \\RD - elevate down - submit_request(EL, REQUEST_DOWN, 0, 130); - strcpy(return_string, "\\!OKRD"); - } - #ifdef FEATURE_GPS - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'C')) { // \\RC - Read coordinates - strcpy(return_string,"\\!OKRC"); - if (latitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} - dtostrf(abs(latitude),0,4,temp_string); - strcat(return_string,temp_string); - strcat(return_string," "); - if (longitude < 0){strcat(return_string,"-");} else {strcat(return_string,"+");} - if (longitude < 100){strcat(return_string,"0");} - dtostrf(abs(longitude),0,4,temp_string); - strcat(return_string,temp_string); - } - #endif //FEATURE_GPS + #endif //FEATURE_CLOCK + + if ((input_buffer[2] == 'S') && (input_buffer[3] == 'A')) { // \?SA - stop azimuth rotation + submit_request(AZ, REQUEST_STOP, 0, 124); + strcpy(return_string,"\\!OKSA"); + } + if ((input_buffer[2] == 'S') && (input_buffer[3] == 'E')) { // \?SE - stop elevation rotation + #ifdef FEATURE_ELEVATION_CONTROL + submit_request(EL, REQUEST_STOP, 0, 125); + #endif + strcpy(return_string,"\\!OKSE"); + } + if ((input_buffer[2] == 'S') && (input_buffer[3] == 'S')) { // \?SS - stop all rotation + submit_request(AZ, REQUEST_STOP, 0, 124); + #ifdef FEATURE_ELEVATION_CONTROL + submit_request(EL, REQUEST_STOP, 0, 125); + #endif + strcpy(return_string,"\\!OKSS"); + } + + if ((input_buffer[2] == 'C') && (input_buffer[3] == 'L')) { // \?CL - read the clock #ifdef FEATURE_CLOCK - if ((input_buffer[2] == 'G') && (input_buffer[3] == 'S')) { // \\GS - query GPS sync - strcpy(return_string,"\\!OKGS"); - if (clock_status == GPS_SYNC){ - strcat(return_string,"1"); - } else { - strcat(return_string,"0"); - } - } - #endif //FEATURE_CLOCK + strcpy(return_string,"\\!OKCL"); + update_time(); + strcat(return_string,clock_string()); + #else //FEATURE_CLOCK + strcpy(return_string,"\\!??CL"); + #endif //FEATURE_CLOCK + } - if ((input_buffer[2] == 'S') && (input_buffer[3] == 'A')) { // \\SA - stop azimuth rotation - submit_request(AZ, REQUEST_STOP, 0, 124); - strcpy(return_string,"\\!OKSA"); - } - if ((input_buffer[2] == 'S') && (input_buffer[3] == 'E')) { // \\SE - stop elevation rotation - #ifdef FEATURE_ELEVATION_CONTROL - submit_request(EL, REQUEST_STOP, 0, 125); - #endif - strcpy(return_string,"\\!OKSE"); - } - if ((input_buffer[2] == 'S') && (input_buffer[3] == 'S')) { // \\SS - stop all rotation - submit_request(AZ, REQUEST_STOP, 0, 124); - #ifdef FEATURE_ELEVATION_CONTROL - submit_request(EL, REQUEST_STOP, 0, 125); - #endif - strcpy(return_string,"\\!OKSS"); - } - - if ((input_buffer[2] == 'C') && (input_buffer[3] == 'L')) { // \\CL - read the clock - #ifdef FEATURE_CLOCK - strcpy(return_string,"\\!OKCL"); - update_time(); - strcat(return_string,clock_string()); - #else //FEATURE_CLOCK - strcpy(return_string,"\\!??CL"); - #endif //FEATURE_CLOCK - } - - if ((input_buffer[2] == 'R') && (input_buffer[3] == 'B')) { // \\RB - reboot - wdt_enable(WDTO_30MS); while (1) {} //ZZZZZZ - TODO - change to reboot flag - } + if ((input_buffer[2] == 'R') && (input_buffer[3] == 'B')) { // \?RB - reboot + wdt_enable(WDTO_30MS); while (1) {} //ZZZZZZ - TODO - change to reboot flag + } - } //if (input_buffer_index == 4) + } //if (input_buffer_index == 4) if (input_buffer_index == 6){ - if ((input_buffer[2] == 'D') && (input_buffer[3] == 'O')) { // \\DOxx - digital pin initialize as output; xx = pin # (01, 02, A0,etc.) + if ((input_buffer[2] == 'D') && (input_buffer[3] == 'O')) { // \?DOxx - digital pin initialize as output; xx = pin # (01, 02, A0,etc.) if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -614,7 +685,7 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte } } - if ((input_buffer[2] == 'D') && ((input_buffer[3] == 'H') || (input_buffer[3] == 'L'))) { // \\DLxx - digital pin write low; xx = pin # \\DHxx - digital pin write high; xx = pin # + if ((input_buffer[2] == 'D') && ((input_buffer[3] == 'H') || (input_buffer[3] == 'L'))) { // \?DLxx - digital pin write low; xx = pin # \\DHxx - digital pin write high; xx = pin # if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -647,7 +718,7 @@ Not implemented yet: */ - if ((input_buffer[2] == 'D') && (input_buffer[3] == 'I')) { // \\DIxx - digital pin initialize as input; xx = pin # + if ((input_buffer[2] == 'D') && (input_buffer[3] == 'I')) { // \?DIxx - digital pin initialize as input; xx = pin # if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -660,7 +731,7 @@ Not implemented yet: } } - if ((input_buffer[2] == 'D') && (input_buffer[3] == 'P')) { // \\DPxx - digital pin initialize as input with pullup; xx = pin # + if ((input_buffer[2] == 'D') && (input_buffer[3] == 'P')) { // \?DPxx - digital pin initialize as input with pullup; xx = pin # if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -674,7 +745,7 @@ Not implemented yet: } } - if ((input_buffer[2] == 'D') && (input_buffer[3] == 'R')) { // \\DRxx - digital pin read; xx = pin # + if ((input_buffer[2] == 'D') && (input_buffer[3] == 'R')) { // \?DRxx - digital pin read; xx = pin # if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -695,7 +766,7 @@ Not implemented yet: } } } - if ((input_buffer[2] == 'A') && (input_buffer[3] == 'R')) { // \\ARxx - analog pin read; xx = pin # + if ((input_buffer[2] == 'A') && (input_buffer[3] == 'R')) { // \?ARxx - analog pin read; xx = pin # if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -728,7 +799,7 @@ Not implemented yet: } } - if ((input_buffer[2] == 'N') && (input_buffer[3] == 'T')) { // \\NTxx - no tone; xx = pin # + if ((input_buffer[2] == 'N') && (input_buffer[3] == 'T')) { // \?NTxx - no tone; xx = pin # byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { pin_value = get_analog_pin(input_buffer[5] - 48); @@ -745,7 +816,7 @@ Not implemented yet: if (input_buffer_index == 9) { - if ((input_buffer[2] == 'G') && (input_buffer[3] == 'A')) { // \\GAxxx.x - go to AZ xxx.x + if ((input_buffer[2] == 'G') && (input_buffer[3] == 'A')) { // \?GAxxx.x - go to AZ xxx.x heading = ((input_buffer[4] - 48) * 100.) + ((input_buffer[5] - 48) * 10.) + (input_buffer[6] - 48.) + ((input_buffer[8] - 48) / 10.); if (((heading >= 0) && (heading < 451)) && (input_buffer[7] == '.')) { submit_request(AZ, REQUEST_AZIMUTH, (heading * HEADING_MULTIPLIER), 136); @@ -754,7 +825,7 @@ Not implemented yet: strcpy(return_string,"\\!??GA"); } } - if ((input_buffer[2] == 'G') && (input_buffer[3] == 'E')) { // \\GExxx.x - go to EL + if ((input_buffer[2] == 'G') && (input_buffer[3] == 'E')) { // \?GExxx.x - go to EL #ifdef FEATURE_ELEVATION_CONTROL heading = ((input_buffer[4] - 48) * 100.) + ((input_buffer[5] - 48) * 10.) + (input_buffer[5] - 48) + ((input_buffer[8] - 48) / 10.); if (((heading >= 0) && (heading < 181)) && (input_buffer[7] == '.')) { @@ -769,7 +840,7 @@ Not implemented yet: } - if ((input_buffer[2] == 'A') && (input_buffer[3] == 'W')) { // \\AWxxyyy - analog pin write; xx = pin #, yyy = value to write (0 - 255) + if ((input_buffer[2] == 'A') && (input_buffer[3] == 'W')) { // \?AWxxyyy - analog pin write; xx = pin #, yyy = value to write (0 - 255) if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -787,7 +858,7 @@ Not implemented yet: } //if (input_buffer_index == 9) if (input_buffer_index == 10) { - if ((input_buffer[2] == 'D') && (input_buffer[3] == 'T')) { // \\DTxxyyyy - digital pin tone output; xx = pin #, yyyy = frequency + if ((input_buffer[2] == 'D') && (input_buffer[3] == 'T')) { // \?DTxxyyyy - digital pin tone output; xx = pin #, yyyy = frequency if ((((input_buffer[4] > 47) && (input_buffer[4] < 58)) || (toupper(input_buffer[4]) == 'A')) && (input_buffer[5] > 47) && (input_buffer[5] < 58)) { byte pin_value = 0; if (toupper(input_buffer[4]) == 'A') { @@ -812,15 +883,15 @@ Not implemented yet: - #endif //UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS + #endif //!defined(OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS) default: strcpy(return_string, "Error."); - } /* switch */ -} /* process_backslash_command */ + } // switch +} // process_backslash_command //----------------------------------------------------------------------- diff --git a/rotator_ethernet.h b/rotator_ethernet.h index c4f3ea5..3c0f30c 100644 --- a/rotator_ethernet.h +++ b/rotator_ethernet.h @@ -11,7 +11,7 @@ void service_ethernet(){ static long last_received_byte0 = 0; #ifdef FEATURE_REMOTE_UNIT_SLAVE - static byte preamble_received = 0; + static byte preamble_received = 0; #endif //FEATURE_REMOTE_UNIT_SLAVE /* this is the server side (receiving bytes from a client such as a master unit receiving commands from a computer @@ -24,7 +24,7 @@ void service_ethernet(){ if ((ethernet_port_buffer_index0) && ((millis()-last_received_byte0) > ETHERNET_MESSAGE_TIMEOUT_MS)){ ethernet_port_buffer_index0 = 0; #ifdef FEATURE_REMOTE_UNIT_SLAVE - preamble_received = 0; + preamble_received = 0; #endif //FEATURE_REMOTE_UNIT_SLAVE } @@ -58,27 +58,27 @@ void service_ethernet(){ char ethernet_preamble[] = ETHERNET_PREAMBLE; #ifdef FEATURE_REMOTE_UNIT_SLAVE - if (preamble_received < 254){ // the master/slave ethernet link has each message prefixed with a preamble - if (ethernet_preamble[preamble_received] == 0){ - preamble_received = 254; - } else { - if (incoming_byte == ethernet_preamble[preamble_received]){ - preamble_received++; + if (preamble_received < 254){ // the master/slave ethernet link has each message prefixed with a preamble + if (ethernet_preamble[preamble_received] == 0){ + preamble_received = 254; } else { - preamble_received = 0; + if (incoming_byte == ethernet_preamble[preamble_received]){ + preamble_received++; + } else { + preamble_received = 0; + } } } - } - // add it to the buffer if it's not a line feed or carriage return and we've received the preamble - if ((incoming_byte != 10) && (incoming_byte != 13) && (preamble_received == 254)) { - ethernet_port_buffer0[ethernet_port_buffer_index0] = incoming_byte; - ethernet_port_buffer_index0++; + // add it to the buffer if it's not a line feed or carriage return and we've received the preamble + if ((incoming_byte != 10) && (incoming_byte != 13) && (preamble_received == 254)) { + ethernet_port_buffer0[ethernet_port_buffer_index0] = incoming_byte; + ethernet_port_buffer_index0++; } #else - if ((incoming_byte != 10) && (incoming_byte != 13)) { // add it to the buffer if it's not a line feed or carriage return - ethernet_port_buffer0[ethernet_port_buffer_index0] = incoming_byte; - ethernet_port_buffer_index0++; - } + if ((incoming_byte != 10) && (incoming_byte != 13)) { // add it to the buffer if it's not a line feed or carriage return + ethernet_port_buffer0[ethernet_port_buffer_index0] = incoming_byte; + ethernet_port_buffer_index0++; + } #endif //FEATURE_REMOTE_UNIT_SLAVE diff --git a/rotator_features.h b/rotator_features.h index 1ba802b..c3e1955 100755 --- a/rotator_features.h +++ b/rotator_features.h @@ -5,21 +5,22 @@ */ /* main features */ -#define FEATURE_ELEVATION_CONTROL // uncomment this for AZ/EL rotators -#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_ELEVATION_CONTROL // uncomment this for AZ/EL rotators +#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_RTC_PCF8583 -#define FEATURE_ETHERNET -#define FEATURE_STEPPER_MOTOR // requires Mega or an AVR with Timer 5 support +//#define FEATURE_ETHERNET +//#define FEATURE_STEPPER_MOTOR // requires Mega or an AVR with Timer 5 support //#define FEATURE_AUTOCORRECT -#define LANGUAGE_ENGLISH +#define LANGUAGE_ENGLISH // all languages customized in rotator_language.h //#define LANGUAGE_SPANISH //#define LANGUAGE_CZECH //#define LANGUAGE_ITALIAN @@ -45,7 +46,7 @@ //#define FEATURE_AZ_POSITION_INCREMENTAL_ENCODER //#define FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER -#define FEATURE_EL_POSITION_POTENTIOMETER +//#define FEATURE_EL_POSITION_POTENTIOMETER //#define FEATURE_EL_POSITION_ROTARY_ENCODER //#define FEATURE_EL_POSITION_PULSE_INPUT //#define FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB // Uncomment for elevation ADXL345 accelerometer support using ADXL345 library @@ -58,7 +59,8 @@ //#define FEATURE_EL_POSITION_MEMSIC_2125 //#define FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER -#define FEATURE_4_BIT_LCD_DISPLAY //Uncomment for classic 4 bit LCD display (most common) + // All displays require k3ngdisplay.h and k3ngdisplay.cpp in the ino directory! +//#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 //#define FEATURE_YOURDUINO_I2C_LCD @@ -112,6 +114,8 @@ //#define OPTION_BUTTON_RELEASE_NO_SLOWDOWN // disables slowdown when CW or CCW button is released, or stop button is depressed #define OPTION_SYNC_RTC_TO_GPS // if both realtime clock and GPS are present, synchronize realtime clock to GPS +#define OPTION_DISPLAY_STATUS +#define OPTION_DISPLAY_HEADING #define OPTION_DISPLAY_HHMM_CLOCK // display HH:MM clock (set position with #define LCD_HHMM_CLOCK_POSITION) //#define OPTION_DISPLAY_HHMMSS_CLOCK // display HH:MM:SS clock (set position with #define LCD_HHMMSS_CLOCK_POSITION) //#define OPTION_DISPLAY_ALT_HHMM_CLOCK_AND_MAIDENHEAD // display alternating HH:MM clock and maidenhead on LCD row 1 (set position with #define LCD_HHMMCLOCK_POSITION) @@ -124,6 +128,7 @@ #define OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY //#define OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define OPTION_DISPLAY_VERSION_ON_STARTUP //code provided by Paolo, IT9IPQ +//#define OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE //#define FEATURE_POWER_SWITCH //#define OPTION_EXTERNAL_ANALOG_REFERENCE //Activate external analog voltage reference (needed for RemoteQTH.com unit) @@ -137,39 +142,7 @@ //#define OPTION_EL_PULSE_DEBOUNCE //#define OPTION_SCANCON_2RMHF3600_INC_ENCODER // use with FEATURE_AZ_POSITION_INCREMENTAL_ENCODER and/or FEATURE_EL_POSITION_INCREMENTAL_ENCODER if using the ScanCon 2RMHF3600 incremental encoder //#define OPTION_RESET_METHOD_JMP_ASM_0 - - -/**************** this section is for code under development ********************************/ -//#define UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS -#define UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY -#define OPTION_DISPLAY_STATUS -#define OPTION_DISPLAY_HEADING -#define LCD_HEADING_ROW 2 -#define LCD_HEADING_FIELD_SIZE 20 -//#define OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE -#define LCD_STATUS_ROW 1 -#define LCD_STATUS_FIELD_SIZE 20 -#define LCD_DIRECTION_ROW 1 -#define LCD_HHMMSS_CLOCK_ROW 1 -#define LCD_HHMM_CLOCK_ROW 1 -#define PARKING_STRING "PARKING" -#define PARKED_STRING "PARKED" -#define PARKING_STATUS_DISPLAY_TIME_MS 5000 - // TODO - eliminate unused strings from settings files -/**************** end of section for code under development ********************************/ - - - - - /* - - Note: - - Ham Radio Deluxe expects AZ and EL in output for Yaesu C command in AZ/EL mode. I'm not sure if this is default behavior for - the Yaesu interface since the C2 command is supposed to be for AZ and EL. If you have problems with other software with this code in AZ/EL mode, - uncomment #define OPTION_C_COMMAND_SENDS_AZ_AND_EL. - - */ +//#define OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS /* ---------------------- debug stuff - don't touch unless you know what you are doing --------------------------- */ diff --git a/rotator_features_ea4tx_ars_usb.h b/rotator_features_ea4tx_ars_usb.h index 72d1a9e..9ad5bde 100644 --- a/rotator_features_ea4tx_ars_usb.h +++ b/rotator_features_ea4tx_ars_usb.h @@ -38,21 +38,11 @@ //#define FEATURE_POWER_SWITCH //#define OPTION_EXTERNAL_ANALOG_REFERENCE //Activate external analog voltage reference (needed for RemoteQTH.com unit) #define OPTION_DISPLAY_DIRECTION_STATUS +#define OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS - - /* - - Note: - - Ham Radio Deluxe expects AZ and EL in output for Yaesu C command in AZ/EL mode. I'm not sure if this is default behavior for - the Yaesu interface since the C2 command is supposed to be for AZ and EL. If you have problems with other software with this code in AZ/EL mode, - uncomment #define OPTION_C_COMMAND_SENDS_AZ_AND_EL. - - */ - /* ---------------------- debug stuff - don't touch unless you know what you are doing --------------------------- */ diff --git a/rotator_features_m0upu.h b/rotator_features_m0upu.h index f69e8b6..b0b762e 100755 --- a/rotator_features_m0upu.h +++ b/rotator_features_m0upu.h @@ -132,33 +132,7 @@ //#define OPTION_EL_PULSE_DEBOUNCE //#define OPTION_SCANCON_2RMHF3600_INC_ENCODER // use with FEATURE_AZ_POSITION_INCREMENTAL_ENCODER and/or FEATURE_EL_POSITION_INCREMENTAL_ENCODER if using the ScanCon 2RMHF3600 incremental encoder //#define OPTION_RESET_METHOD_JMP_ASM_0 - -//#define UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS -#define UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY -//#define OPTION_DISPLAY_STATUS_TERSE // TODO - rename this -#define OPTION_DISPLAY_HEADING -#define LCD_HEADING_ROW 2 -#define LCD_HEADING_FIELD_SIZE 20 -//#define OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE -#define LCD_STATUS_ROW 1 -#define LCD_STATUS_FIELD_SIZE 20 -#define LCD_DIRECTION_ROW 1 -#define LCD_HHMMSS_CLOCK_ROW 1 -#define LCD_HHMM_CLOCK_ROW 1 -#define PARKING_STRING "PARKING" -#define PARKED_STRING "PARKED" -#define PARKING_STATUS_DISPLAY_TIME_MS 5000 - - - /* - - Note: - - Ham Radio Deluxe expects AZ and EL in output for Yaesu C command in AZ/EL mode. I'm not sure if this is default behavior for - the Yaesu interface since the C2 command is supposed to be for AZ and EL. If you have problems with other software with this code in AZ/EL mode, - uncomment #define OPTION_C_COMMAND_SENDS_AZ_AND_EL. - - */ +#define OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS /* ---------------------- debug stuff - don't touch unless you know what you are doing --------------------------- */ diff --git a/rotator_features_test.h b/rotator_features_test.h index b95a591..84e7ffd 100755 --- a/rotator_features_test.h +++ b/rotator_features_test.h @@ -1,30 +1,30 @@ /* - TEST Hardware !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TEST Hardware !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ -/* main features */ #define FEATURE_ELEVATION_CONTROL // uncomment this for AZ/EL rotators #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 //#define FEATURE_AUTOCORRECT -#define LANGUAGE_ENGLISH +#define LANGUAGE_ENGLISH // all languages customized in rotator_language.h //#define LANGUAGE_SPANISH //#define LANGUAGE_CZECH //#define LANGUAGE_ITALIAN //#define LANGUAGE_PORTUGUESE_BRASIL +//#define LANGUAGE_GERMAN /* master and remote slave unit functionality */ //#define FEATURE_REMOTE_UNIT_SLAVE // uncomment this to make this unit a remote unit controlled by a host unit @@ -43,6 +43,7 @@ //#define FEATURE_AZ_POSITION_POLOLU_LSM303 // Uncomment for azimuth using LSM303 compass and Polulu library //#define FEATURE_AZ_POSITION_HH12_AS5045_SSI //#define FEATURE_AZ_POSITION_INCREMENTAL_ENCODER +//#define FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER #define FEATURE_EL_POSITION_POTENTIOMETER //#define FEATURE_EL_POSITION_ROTARY_ENCODER @@ -55,21 +56,24 @@ //#define FEATURE_EL_POSITION_HH12_AS5045_SSI //#define FEATURE_EL_POSITION_INCREMENTAL_ENCODER //#define FEATURE_EL_POSITION_MEMSIC_2125 +//#define FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER -#define FEATURE_4_BIT_LCD_DISPLAY //Uncomment for classic 4 bit LCD display (most common) + // All displays require k3ngdisplay.h and k3ngdisplay.cpp in the ino directory! +#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 //#define FEATURE_YOURDUINO_I2C_LCD //#define FEATURE_RFROBOT_I2C_DISPLAY -//#define FEATURE_ANALOG_OUTPUT_PINS //#define FEATURE_YWROBOT_I2C_DISPLAY +//#define FEATURE_ANALOG_OUTPUT_PINS + //#define FEATURE_SUN_PUSHBUTTON_AZ_EL_CALIBRATION //#define FEATURE_MOON_PUSHBUTTON_AZ_EL_CALIBRATION /* preset rotary encoder features and options */ -//#define FEATURE_AZ_PRESET_ENCODER // Uncomment for Rotary Encoder Azimuth Preset support -//#define FEATURE_EL_PRESET_ENCODER // Uncomment for Rotary Encoder Elevation Preset support (requires FEATURE_AZ_PRESET_ENCODER above) +#define FEATURE_AZ_PRESET_ENCODER // Uncomment for Rotary Encoder Azimuth Preset support +#define FEATURE_EL_PRESET_ENCODER // Uncomment for Rotary Encoder Elevation Preset support (requires FEATURE_AZ_PRESET_ENCODER above) #define OPTION_ENCODER_HALF_STEP_MODE #define OPTION_ENCODER_ENABLE_PULLUPS // define to enable weak pullups on rotary encoder pins #define OPTION_INCREMENTAL_ENCODER_PULLUPS // define to enable weak pullups on 3 phase incremental rotary encoder pins @@ -108,18 +112,23 @@ //#define OPTION_PULSE_IGNORE_AMBIGUOUS_PULSES // for azimuth and elevation position pulse input feature, ignore pulses that arrive when no rotation is active //#define OPTION_BUTTON_RELEASE_NO_SLOWDOWN // disables slowdown when CW or CCW button is released, or stop button is depressed #define OPTION_SYNC_RTC_TO_GPS // if both realtime clock and GPS are present, synchronize realtime clock to GPS -//#define OPTION_DISPLAY_HHMM_CLOCK // display HH:MM clock on LCD row 1 (set position with #define LCD_HHMM_CLOCK_POSITION) -//#define OPTION_DISPLAY_HHMMSS_CLOCK // display HH:MM:SS clock on LCD row 1 (set position with #define LCD_HHMMSS_CLOCK_POSITION) + +#define OPTION_DISPLAY_STATUS +#define OPTION_DISPLAY_HEADING +#define OPTION_DISPLAY_HHMM_CLOCK // display HH:MM clock (set position with #define LCD_HHMM_CLOCK_POSITION) +//#define OPTION_DISPLAY_HHMMSS_CLOCK // display HH:MM:SS clock (set position with #define LCD_HHMMSS_CLOCK_POSITION) //#define OPTION_DISPLAY_ALT_HHMM_CLOCK_AND_MAIDENHEAD // display alternating HH:MM clock and maidenhead on LCD row 1 (set position with #define LCD_HHMMCLOCK_POSITION) //#define OPTION_DISPLAY_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD // display constant HH:MM:SS clock and maidenhead on LCD row 1 (set position with #define LCD_CONSTANT_HHMMSSCLOCK_MAIDENHEAD_POSITION) //#define OPTION_DISPLAY_BIG_CLOCK // display date & time clock (set row with #define LCD_BIG_CLOCK_ROW) //#define OPTION_CLOCK_ALWAYS_HAVE_HOUR_LEADING_ZERO -//#define OPTION_DISPLAY_GPS_INDICATOR // display GPS indicator on LCD - set position with LCD_GPS_INDICATOR_POSITION and LCD_GPS_INDICATOR_ROW -//#define OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY -//#define OPTION_DISPLAY_DIRECTION_STATUS // N, W, E, S, NW, etc. direction indicator in row 1 center -//#define OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY +#define OPTION_DISPLAY_GPS_INDICATOR // display GPS indicator on LCD - set position with LCD_GPS_INDICATOR_POSITION and LCD_GPS_INDICATOR_ROW +#define OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY +//#define OPTION_DISPLAY_DIRECTION_STATUS // N, W, E, S, NW, etc. direction indicator +#define OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY //#define OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL -//#define OPTION_DISPLAY_VERSION_ON_STARTUP //code provided by Paolo, IT9IPQ +#define OPTION_DISPLAY_VERSION_ON_STARTUP //code provided by Paolo, IT9IPQ +//#define OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE + //#define FEATURE_POWER_SWITCH //#define OPTION_EXTERNAL_ANALOG_REFERENCE //Activate external analog voltage reference (needed for RemoteQTH.com unit) //#define OPTION_SYNC_MASTER_CLOCK_TO_SLAVE // use when GPS unit is connected to slave unit and you want to synchronize the master unit clock to the slave unit GPS clock @@ -132,36 +141,8 @@ //#define OPTION_EL_PULSE_DEBOUNCE //#define OPTION_SCANCON_2RMHF3600_INC_ENCODER // use with FEATURE_AZ_POSITION_INCREMENTAL_ENCODER and/or FEATURE_EL_POSITION_INCREMENTAL_ENCODER if using the ScanCon 2RMHF3600 incremental encoder //#define OPTION_RESET_METHOD_JMP_ASM_0 +//#define OPTION_SAVE_MEMORY_EXCLUDE_REMOTE_CMDS -/**************** this section is for code under development ********************************/ -//#define UNDER_DEVELOPMENT_REMOTE_UNIT_COMMANDS -#define UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY -#define OPTION_DISPLAY_STATUS -#define OPTION_DISPLAY_HEADING -#define LCD_HEADING_ROW 2 -#define LCD_HEADING_FIELD_SIZE 16//20 -//#define OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE -#define LCD_STATUS_ROW 1 -#define LCD_STATUS_FIELD_SIZE 16//20 -#define LCD_DIRECTION_ROW 1 -#define LCD_HHMMSS_CLOCK_ROW 1 -#define LCD_HHMM_CLOCK_ROW 1 -#define PARKING_STRING "PARKING" -#define PARKED_STRING "PARKED" -#define PARKING_STATUS_DISPLAY_TIME_MS 5000 - // TODO - eliminate unused strings from settings files -/**************** end of section for code under development ********************************/ - - - /* - - Note: - - Ham Radio Deluxe expects AZ and EL in output for Yaesu C command in AZ/EL mode. I'm not sure if this is default behavior for - the Yaesu interface since the C2 command is supposed to be for AZ and EL. If you have problems with other software with this code in AZ/EL mode, - uncomment #define OPTION_C_COMMAND_SENDS_AZ_AND_EL. - - */ /* ---------------------- debug stuff - don't touch unless you know what you are doing --------------------------- */ @@ -170,6 +151,7 @@ #define DEFAULT_DEBUG_STATE 0 // 1 = activate debug mode at startup; this should be set to zero unless you're debugging something at startup #define DEBUG_DUMP // normally compile with this activated unless you're really trying to save memory +// #define DEBUG_LOOP // #define DEBUG_MEMORY // #define DEBUG_BUTTONS // #define DEBUG_SERIAL @@ -220,6 +202,8 @@ // #define DEBUG_POLOLU_LSM303_CALIBRATION // #define DEBUG_STEPPER // #define DEBUG_AUTOCORRECT +// #define DEBUG_A2_ENCODER +// #define DEBUG_A2_ENCODER_LOOPBACK_TEST diff --git a/rotator_language.h b/rotator_language.h new file mode 100644 index 0000000..67a63aa --- /dev/null +++ b/rotator_language.h @@ -0,0 +1,270 @@ +#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) +#define MOON_STRING "moon " +#define SUN_STRING "sun " +#define AZ_TARGET_STRING "Az Target " +#define EL_TARGET_STRING "El Target " +#define TARGET_STRING "Target " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Parked" +/* +#define ROTATING_CW_STRING "Rotating CW" // depricated in 2015090402 +#define ROTATING_CCW_STRING "Rotating CCW" +#define ROTATING_TO_STRING "Rotating to " +#define ELEVATING_TO_STRING "Elevating to " +#define ELEVATING_UP_STRING "Elevating Up" +#define ELEVATING_DOWN_STRING "Elevating Down" +#define ROTATING_STRING "Rotating " +*/ +#define CW_STRING "CW" +#define CCW_STRING "CCW" +#define UP_STRING "UP" +#define DOWN_STRING "DOWN" +#define AZIMUTH_STRING "Azimuth " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "N" +#define W_STRING "W" +#define S_STRING "S" +#define E_STRING "E" +#define NW_STRING "NW" +#define SW_STRING "SW" +#define SE_STRING "SE" +#define NE_STRING "NE" +#define NNW_STRING "NNW" +#define WNW_STRING "WNW" +#define WSW_STRING "WSW" +#define SSW_STRING "SSW" +#define SSE_STRING "SSE" +#define ESE_STRING "ESE" +#define ENE_STRING "ENE" +#define NNE_STRING "NNE" +#endif //LANGUAGE_ENGLISH + +#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO +#define MOON_STRING "Luna " +#define SUN_STRING "Sol " +#define AZ_TARGET_STRING "Az Objetivo " +#define EL_TARGET_STRING "El Objetivo " +#define TARGET_STRING "Objetivo " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Aparcado" +/* +#define ROTATING_CW_STRING "Girando Dcha" +#define ROTATING_CCW_STRING "Girando Izq" +#define ROTATING_TO_STRING "Girando a " +#define ELEVATING_TO_STRING "Elevando a " +#define ELEVATING_UP_STRING "Subiendo" +#define ELEVATING_DOWN_STRING "Bajando" +#define ROTATING_STRING "Girando " +*/ +#define CW_STRING "Dcha" +#define CCW_STRING "Izq" +#define UP_STRING "Arriba" +#define DOWN_STRING "Abajo" +#define AZIMUTH_STRING "Azimuth " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "N" +#define W_STRING "O" +#define S_STRING "S" +#define E_STRING "E" +#define NW_STRING "NO" +#define SW_STRING "SO" +#define SE_STRING "SE" +#define NE_STRING "NE" +#define NNW_STRING "NNO" +#define WNW_STRING "ONO" +#define WSW_STRING "OSO" +#define SSW_STRING "SSO" +#define SSE_STRING "SSE" +#define ESE_STRING "ESE" +#define ENE_STRING "ENE" +#define NNE_STRING "NNE" +#endif //LANGUAGE_SPANISH + +#ifdef LANGUAGE_CZECH // courtesy of Jan, OK2ZAW +#define MOON_STRING "mesic " +#define SUN_STRING "slunce " +#define AZ_TARGET_STRING "Az cíl " +#define EL_TARGET_STRING "El cíl " +#define TARGET_STRING "Cil " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Parkovat" +/* +#define ROTATING_CW_STRING "Otacim CW" +#define ROTATING_CCW_STRING "Otacim CCW" +#define ROTATING_TO_STRING "Otacim na " +#define ELEVATING_TO_STRING "Elevovat na " +#define ELEVATING_UP_STRING "Elevovat nahoru" +#define ELEVATING_DOWN_STRING "Elevovat dolu" +#define ROTATING_STRING "Otacet " +*/ +#define CW_STRING "CW" +#define CCW_STRING "CCW" +#define UP_STRING "Nahoru" +#define DOWN_STRING "Dolu" +#define AZIMUTH_STRING "Azimut " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "smer ^ KL" +#define W_STRING "smer < HK" +#define S_STRING "smer v ZS" +#define E_STRING "smer > VK" +#define NW_STRING "smer < W" +#define SW_STRING "smer v VP8" +#define SE_STRING "smer > HZ" +#define NE_STRING "smer ^ JA" +#define NNW_STRING "smer ^ VE" +#define WNW_STRING "smer < CO" +#define WSW_STRING "smer < PY" +#define SSW_STRING "smer v ZD9" +#define SSE_STRING "smer v 5R" +#define ESE_STRING "smer > 8Q" +#define ENE_STRING "smer > ZL" +#define NNE_STRING "smer ^ UA0" +#endif //LANGUAGE_CZECH + +#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ +#define MOON_STRING "luna" +#define SUN_STRING "sole " +#define AZ_TARGET_STRING "Punta Az " +#define EL_TARGET_STRING "Punta El " +#define TARGET_STRING "Punta " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Posa " +/* +#define ROTATING_CW_STRING "Ruota DX > " +#define ROTATING_CCW_STRING "Ruota SX < " +#define ROTATING_TO_STRING "Ruota verso " +#define ELEVATING_TO_STRING "Alza verso " +#define ELEVATING_UP_STRING "Alzo Su " +#define ELEVATING_DOWN_STRING "Abbasso Giu' " +#define ROTATING_STRING "Ruota " +*/ +#define CW_STRING "DX" +#define CCW_STRING "SX " +#define UP_STRING "SU" +#define DOWN_STRING "GIU'" +#define AZIMUTH_STRING "Azimuth " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "N" +#define W_STRING "W" +#define S_STRING "S" +#define E_STRING "E" +#define NW_STRING "NW" +#define SW_STRING "SW" +#define SE_STRING "SE" +#define NE_STRING "NE" +#define NNW_STRING "NNW" +#define WNW_STRING "WNW" +#define WSW_STRING "WSW" +#define SSW_STRING "SSW" +#define SSE_STRING "SSE" +#define ESE_STRING "ESE" +#define ENE_STRING "ENE" +#define NNE_STRING "NNE" +#endif //LANGUAGE_ITALIAN + +#ifdef LANGUAGE_PORTUGUESE_BRASIL // courtesy of Ismael, PY4PI +#define MOON_STRING "lua " +#define SUN_STRING "sol " +#define AZ_TARGET_STRING "Objetivo Az " +#define EL_TARGET_STRING "Objetivo El " +#define TARGET_STRING "Objetivo " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Estacionado" +/* +#define ROTATING_CW_STRING "Rodando DIR" +#define ROTATING_CCW_STRING "Rodando ESQ" +#define ROTATING_TO_STRING "Rodando para " +#define ELEVATING_TO_STRING "Elevando para " +#define ELEVATING_UP_STRING "Subindo" +#define ELEVATING_DOWN_STRING "Descendo" +#define ROTATING_STRING "Rodando " +*/ +#define CW_STRING "DIR" +#define CCW_STRING "ESQ" +#define UP_STRING "SOBE" +#define DOWN_STRING "DESCE" +#define AZIMUTH_STRING "Azimute " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "N" +#define W_STRING "O" +#define S_STRING "S" +#define E_STRING "L" +#define NW_STRING "NO" +#define SW_STRING "SO" +#define SE_STRING "SL" +#define NE_STRING "NL" +#define NNW_STRING "NNO" +#define WNW_STRING "ONO" +#define WSW_STRING "OSO" +#define SSW_STRING "SSO" +#define SSE_STRING "SSL" +#define ESE_STRING "LSL" +#define ENE_STRING "LNL" +#define NNE_STRING "NNL" +#endif //LANGUAGE_PORTUGUESE_BRASIL + + +#ifdef LANGUAGE_GERMAN // courtesy of Ronny DM2RM +#define MOON_STRING "MOND " +#define SUN_STRING "SONNE " +#define AZ_TARGET_STRING "Az Ziel " +#define EL_TARGET_STRING "El Ziel " +#define TARGET_STRING "Ziel " +#define PARKING_STRING "Parking" +#define PARKED_STRING "Parken" +/* +#define ROTATING_CW_STRING "Drehen CW" +#define ROTATING_CCW_STRING "Drehen CCW" +#define ROTATING_TO_STRING "Drehen nach " +#define ELEVATING_TO_STRING "Elevation nach " +#define ELEVATING_UP_STRING "Elevation Auf" +#define ELEVATING_DOWN_STRING "Elevation Ab" +#define ROTATING_STRING "Drehen " +*/ +#define CW_STRING "CW" +#define CCW_STRING "CCW" +#define UP_STRING "AUF" +#define DOWN_STRING "AB" +#define AZIMUTH_STRING "Azimuth " +#define AZ_STRING "Az" +#define AZ_SPACE_STRING "Az " +#define SPACE_EL_STRING " El" +#define SPACE_EL_SPACE_STRING " El " +#define GPS_STRING "GPS" +#define N_STRING "N (KL)" +#define W_STRING "W (HK)" +#define S_STRING "S (ZS)" +#define E_STRING "O (YB)" +#define NW_STRING "NW (W8)" +#define SW_STRING "SW (PY)" +#define SE_STRING "SO (HZ)" +#define NE_STRING "NO (JA" +#define NNW_STRING "NNW (VE)" +#define WNW_STRING "WNW (XE)" +#define WSW_STRING "WSW (OA)" +#define SSW_STRING "SSW (ZD7)" +#define SSE_STRING "SSO (5R)" +#define ESE_STRING "OSO (8Q)" +#define ENE_STRING "ONO (ZL)" +#define NNE_STRING "NNO (UA0)" +#endif //LANGUAGE_GERMAN diff --git a/rotator_pins_test.h b/rotator_pins_test.h index 7cc06ee..7a0c615 100644 --- a/rotator_pins_test.h +++ b/rotator_pins_test.h @@ -1,3 +1,12 @@ + +/* + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TEST Hardware !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +*/ + + /* LEDs left to right 6 - PWM 7 - NO PWM diff --git a/rotator_settings.h b/rotator_settings.h index 78a364b..21a1922 100755 --- a/rotator_settings.h +++ b/rotator_settings.h @@ -123,6 +123,15 @@ You can tweak these, but read the online documentation! #define LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define SPLASH_SCREEN_TIME 3000 +#define LCD_HEADING_ROW 2 +#define LCD_HEADING_FIELD_SIZE 20 +#define LCD_STATUS_ROW 1 +#define LCD_STATUS_FIELD_SIZE 20 +#define LCD_DIRECTION_ROW 1 +#define LCD_HHMMSS_CLOCK_ROW 1 +#define LCD_HHMM_CLOCK_ROW 1 +#define PARKING_STATUS_DISPLAY_TIME_MS 5000 + #define AZ_BRAKE_DELAY 3000 // in milliseconds #define EL_BRAKE_DELAY 3000 // in milliseconds @@ -206,258 +215,6 @@ You can tweak these, but read the online documentation! #define SUN_AOS_ELEVATION_MIN 0 #define SUN_AOS_ELEVATION_MAX 180 -#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) -#define MOON_STRING "moon " -#define SUN_STRING "sun " -#define AZ_TARGET_STRING "Az Target " -#define EL_TARGET_STRING "El Target " -#define TARGET_STRING "Target " -#define PARKED_STRING "Parked" -#define ROTATING_CW_STRING "Rotating CW" -#define ROTATING_CCW_STRING "Rotating CCW" -#define ROTATING_TO_STRING "Rotating to " -#define ELEVATING_TO_STRING "Elevating to " -#define ELEVATING_UP_STRING "Elevating Up" -#define ELEVATING_DOWN_STRING "Elevating Down" -#define ROTATING_STRING "Rotating " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "UP" -#define DOWN_STRING "DOWN" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ENGLISH - -#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO -#define MOON_STRING "Luna " -#define SUN_STRING "Sol " -#define AZ_TARGET_STRING "Az Objetivo " -#define EL_TARGET_STRING "El Objetivo " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Aparcado" -#define ROTATING_CW_STRING "Girando Dcha" -#define ROTATING_CCW_STRING "Girando Izq" -#define ROTATING_TO_STRING "Girando a " -#define ELEVATING_TO_STRING "Elevando a " -#define ELEVATING_UP_STRING "Subiendo" -#define ELEVATING_DOWN_STRING "Bajando" -#define ROTATING_STRING "Girando " -#define CW_STRING "Dcha" -#define CCW_STRING "Izq" -#define UP_STRING "Arriba" -#define DOWN_STRING "Abajo" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_SPANISH - -#ifdef LANGUAGE_CZECH // courtesy of Jan, OK2ZAW -#define MOON_STRING "mesic " -#define SUN_STRING "slunce " -#define AZ_TARGET_STRING "Az cíl " -#define EL_TARGET_STRING "El cíl " -#define TARGET_STRING "Cil " -#define PARKED_STRING "Parkovat" -#define ROTATING_CW_STRING "Otacim CW" -#define ROTATING_CCW_STRING "Otacim CCW" -#define ROTATING_TO_STRING "Otacim na " -#define ELEVATING_TO_STRING "Elevovat na " -#define ELEVATING_UP_STRING "Elevovat nahoru" -#define ELEVATING_DOWN_STRING "Elevovat dolu" -#define ROTATING_STRING "Otacet " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "Nahoru" -#define DOWN_STRING "Dolu" -#define AZIMUTH_STRING "Azimut " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "smer ^ KL" -#define W_STRING "smer < HK" -#define S_STRING "smer v ZS" -#define E_STRING "smer > VK" -#define NW_STRING "smer < W" -#define SW_STRING "smer v VP8" -#define SE_STRING "smer > HZ" -#define NE_STRING "smer ^ JA" -#define NNW_STRING "smer ^ VE" -#define WNW_STRING "smer < CO" -#define WSW_STRING "smer < PY" -#define SSW_STRING "smer v ZD9" -#define SSE_STRING "smer v 5R" -#define ESE_STRING "smer > 8Q" -#define ENE_STRING "smer > ZL" -#define NNE_STRING "smer ^ UA0" -#endif //LANGUAGE_CZECH - -#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ -#define MOON_STRING "luna" -#define SUN_STRING "sole " -#define AZ_TARGET_STRING "Punta Az " -#define EL_TARGET_STRING "Punta El " -#define TARGET_STRING "Punta " -#define PARKED_STRING "Posa " -#define ROTATING_CW_STRING "Ruota DX > " -#define ROTATING_CCW_STRING "Ruota SX < " -#define ROTATING_TO_STRING "Ruota verso " -#define ELEVATING_TO_STRING "Alza verso " -#define ELEVATING_UP_STRING "Alzo Su " -#define ELEVATING_DOWN_STRING "Abbasso Giu' " -#define ROTATING_STRING "Ruota " -#define CW_STRING "DX" -#define CCW_STRING "SX " -#define UP_STRING "SU" -#define DOWN_STRING "GIU'" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ITALIAN - -#ifdef LANGUAGE_PORTUGUESE_BRASIL // courtesy of Ismael, PY4PI -#define MOON_STRING "lua " -#define SUN_STRING "sol " -#define AZ_TARGET_STRING "Objetivo Az " -#define EL_TARGET_STRING "Objetivo El " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Estacionado" -#define ROTATING_CW_STRING "Rodando DIR" -#define ROTATING_CCW_STRING "Rodando ESQ" -#define ROTATING_TO_STRING "Rodando para " -#define ELEVATING_TO_STRING "Elevando para " -#define ELEVATING_UP_STRING "Subindo" -#define ELEVATING_DOWN_STRING "Descendo" -#define ROTATING_STRING "Rodando " -#define CW_STRING "DIR" -#define CCW_STRING "ESQ" -#define UP_STRING "SOBE" -#define DOWN_STRING "DESCE" -#define AZIMUTH_STRING "Azimute " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "L" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SL" -#define NE_STRING "NL" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSL" -#define ESE_STRING "LSL" -#define ENE_STRING "LNL" -#define NNE_STRING "NNL" -#endif //LANGUAGE_PORTUGUESE_BRASIL - - -#ifdef LANGUAGE_GERMAN // courtesy of Ronny DM2RM -#define MOON_STRING "MOND " -#define SUN_STRING "SONNE " -#define AZ_TARGET_STRING "Az Ziel " -#define EL_TARGET_STRING "El Ziel " -#define TARGET_STRING "Ziel " -#define PARKED_STRING "Parken" -#define ROTATING_CW_STRING "Drehen CW" -#define ROTATING_CCW_STRING "Drehen CCW" -#define ROTATING_TO_STRING "Drehen nach " -#define ELEVATING_TO_STRING "Elevation nach " -#define ELEVATING_UP_STRING "Elevation Auf" -#define ELEVATING_DOWN_STRING "Elevation Ab" -#define ROTATING_STRING "Drehen " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "AUF" -#define DOWN_STRING "AB" -#define AZIMUTH_STRING "Azimuth " //-------------------------------------------------------------------------------------------------------------- -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N (KL)" -#define W_STRING "W (HK)" -#define S_STRING "S (ZS)" -#define E_STRING "O (YB)" -#define NW_STRING "NW (W8)" -#define SW_STRING "SW (PY)" -#define SE_STRING "SO (HZ)" -#define NE_STRING "NO (JA" -#define NNW_STRING "NNW (VE)" -#define WNW_STRING "WNW (XE)" -#define WSW_STRING "WSW (OA)" -#define SSW_STRING "SSW (ZD7)" -#define SSE_STRING "SSO (5R)" -#define ESE_STRING "OSO (8Q)" -#define ENE_STRING "ONO (ZL)" -#define NNE_STRING "NNO (UA0)" -#endif //LANGUAGE_GERMAN #define TRACKING_ACTIVE_CHAR "*" @@ -563,68 +320,40 @@ You can tweak these, but read the online documentation! */ -#if !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - #if defined(FEATURE_4_BIT_LCD_DISPLAY) - LiquidCrystal lcd(lcd_4_bit_rs_pin, lcd_4_bit_enable_pin, lcd_4_bit_d4_pin, lcd_4_bit_d5_pin, lcd_4_bit_d6_pin, lcd_4_bit_d7_pin); - #endif //FEATURE_4_BIT_LCD_DISPLAY - - #ifdef FEATURE_ADAFRUIT_I2C_LCD - Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield(); - #endif //FEATURE_ADAFRUIT_I2C_LCD - - #ifdef FEATURE_YOURDUINO_I2C_LCD - #define I2C_ADDR 0x20 - #define BACKLIGHT_PIN 3 - #define LED_OFF 1 - #define LED_ON 0 - LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); - #endif //FEATURE_YOURDUINO_I2C_LCD - - #ifdef FEATURE_RFROBOT_I2C_DISPLAY - LiquidCrystal_I2C lcd(0x27,16,2); - #endif //FEATURE_RFROBOT_I2C_DISPLAY - - #ifdef FEATURE_YWROBOT_I2C_DISPLAY - #include - #include - LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); - #endif //FEATURE_YWROBOT_I2C_DISPLAY - -#else - K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); -#endif //!defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - +#if defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_YWROBOT_I2C_DISPLAY) + K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); +#endif #ifdef FEATURE_AZ_POSITION_HMC5883L -HMC5883L compass; + HMC5883L compass; #endif //FEATURE_AZ_POSITION_HMC5883L #ifdef FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB -ADXL345 accel; + ADXL345 accel; #endif //FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB #ifdef FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB -Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); + Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); #endif //FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB #if defined(FEATURE_EL_POSITION_ADAFRUIT_LSM303) || defined(FEATURE_AZ_POSITION_ADAFRUIT_LSM303) -Adafruit_LSM303 lsm; + Adafruit_LSM303 lsm; #endif #if defined(FEATURE_AZ_POSITION_POLOLU_LSM303) || defined(FEATURE_EL_POSITION_POLOLU_LSM303) -LSM303 compass; -LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; -char report[80]; + LSM303 compass; + LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; + char report[80]; #endif //FEATURE_AZ_POSITION_POLOLU_LSM303 #ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 azimuth_hh12; + #include "hh12.h" + hh12 azimuth_hh12; #endif //FEATURE_AZ_POSITION_HH12_AS5045_SSI #ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 elevation_hh12; + #include "hh12.h" + hh12 elevation_hh12; #endif //FEATURE_EL_POSITION_HH12_AS5045_SSI #ifdef FEATURE_GPS diff --git a/rotator_settings_ea4tx_ars_usb.h b/rotator_settings_ea4tx_ars_usb.h index a35dfd0..16e541d 100755 --- a/rotator_settings_ea4tx_ars_usb.h +++ b/rotator_settings_ea4tx_ars_usb.h @@ -123,6 +123,15 @@ You can tweak these, but read the online documentation! #define LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define SPLASH_SCREEN_TIME 3000 +#define LCD_HEADING_ROW 2 +#define LCD_HEADING_FIELD_SIZE 20 +#define LCD_STATUS_ROW 1 +#define LCD_STATUS_FIELD_SIZE 20 +#define LCD_DIRECTION_ROW 1 +#define LCD_HHMMSS_CLOCK_ROW 1 +#define LCD_HHMM_CLOCK_ROW 1 +#define PARKING_STATUS_DISPLAY_TIME_MS 5000 + #define AZ_BRAKE_DELAY 3000 // in milliseconds #define EL_BRAKE_DELAY 3000 // in milliseconds @@ -206,216 +215,6 @@ You can tweak these, but read the online documentation! #define SUN_AOS_ELEVATION_MIN 0 #define SUN_AOS_ELEVATION_MAX 180 -#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) -#define MOON_STRING "moon " -#define SUN_STRING "sun " -#define AZ_TARGET_STRING "Az Target " -#define EL_TARGET_STRING "El Target " -#define TARGET_STRING "Target " -#define PARKED_STRING "Parked" -#define ROTATING_CW_STRING "Rotating CW" -#define ROTATING_CCW_STRING "Rotating CCW" -#define ROTATING_TO_STRING "Rotating to " -#define ELEVATING_TO_STRING "Elevating to " -#define ELEVATING_UP_STRING "Elevating Up" -#define ELEVATING_DOWN_STRING "Elevating Down" -#define ROTATING_STRING "Rotating " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "UP" -#define DOWN_STRING "DOWN" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ENGLISH - -#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO -#define MOON_STRING "Luna " -#define SUN_STRING "Sol " -#define AZ_TARGET_STRING "Az Objetivo " -#define EL_TARGET_STRING "El Objetivo " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Aparcado" -#define ROTATING_CW_STRING "Girando Dcha" -#define ROTATING_CCW_STRING "Girando Izq" -#define ROTATING_TO_STRING "Girando a " -#define ELEVATING_TO_STRING "Elevando a " -#define ELEVATING_UP_STRING "Subiendo" -#define ELEVATING_DOWN_STRING "Bajando" -#define ROTATING_STRING "Girando " -#define CW_STRING "Dcha" -#define CCW_STRING "Izq" -#define UP_STRING "Arriba" -#define DOWN_STRING "Abajo" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_SPANISH - -#ifdef LANGUAGE_CZECH // courtesy of Jan, OK2ZAW -#define MOON_STRING "mesic " -#define SUN_STRING "slunce " -#define AZ_TARGET_STRING "Az cíl " -#define EL_TARGET_STRING "El cíl " -#define TARGET_STRING "Cil " -#define PARKED_STRING "Parkovat" -#define ROTATING_CW_STRING "Otacim CW" -#define ROTATING_CCW_STRING "Otacim CCW" -#define ROTATING_TO_STRING "Otacim na " -#define ELEVATING_TO_STRING "Elevovat na " -#define ELEVATING_UP_STRING "Elevovat nahoru" -#define ELEVATING_DOWN_STRING "Elevovat dolu" -#define ROTATING_STRING "Otacet " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "Nahoru" -#define DOWN_STRING "Dolu" -#define AZIMUTH_STRING "Azimut " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "smer ^ KL" -#define W_STRING "smer < HK" -#define S_STRING "smer v ZS" -#define E_STRING "smer > VK" -#define NW_STRING "smer < W" -#define SW_STRING "smer v VP8" -#define SE_STRING "smer > HZ" -#define NE_STRING "smer ^ JA" -#define NNW_STRING "smer ^ VE" -#define WNW_STRING "smer < CO" -#define WSW_STRING "smer < PY" -#define SSW_STRING "smer v ZD9" -#define SSE_STRING "smer v 5R" -#define ESE_STRING "smer > 8Q" -#define ENE_STRING "smer > ZL" -#define NNE_STRING "smer ^ UA0" -#endif //LANGUAGE_CZECH - -#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ -#define MOON_STRING "luna" -#define SUN_STRING "sole " -#define AZ_TARGET_STRING "Punta Az " -#define EL_TARGET_STRING "Punta El " -#define TARGET_STRING "Punta " -#define PARKED_STRING "Posa " -#define ROTATING_CW_STRING "Ruota DX > " -#define ROTATING_CCW_STRING "Ruota SX < " -#define ROTATING_TO_STRING "Ruota verso " -#define ELEVATING_TO_STRING "Alza verso " -#define ELEVATING_UP_STRING "Alzo Su " -#define ELEVATING_DOWN_STRING "Abbasso Giu' " -#define ROTATING_STRING "Ruota " -#define CW_STRING "DX" -#define CCW_STRING "SX " -#define UP_STRING "SU" -#define DOWN_STRING "GIU'" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ITALIAN - -#ifdef LANGUAGE_PORTUGUESE_BRASIL // courtesy of Ismael, PY4PI -#define MOON_STRING "lua " -#define SUN_STRING "sol " -#define AZ_TARGET_STRING "Objetivo Az " -#define EL_TARGET_STRING "Objetivo El " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Estacionado" -#define ROTATING_CW_STRING "Rodando DIR" -#define ROTATING_CCW_STRING "Rodando ESQ" -#define ROTATING_TO_STRING "Rodando para " -#define ELEVATING_TO_STRING "Elevando para " -#define ELEVATING_UP_STRING "Subindo" -#define ELEVATING_DOWN_STRING "Descendo" -#define ROTATING_STRING "Rodando " -#define CW_STRING "DIR" -#define CCW_STRING "ESQ" -#define UP_STRING "SOBE" -#define DOWN_STRING "DESCE" -#define AZIMUTH_STRING "Azimute " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "L" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SL" -#define NE_STRING "NL" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSL" -#define ESE_STRING "LSL" -#define ENE_STRING "LNL" -#define NNE_STRING "NNL" -#endif //LANGUAGE_PORTUGUESE_BRASIL - #define TRACKING_ACTIVE_CHAR "*" #define TRACKING_INACTIVE_CHAR "-" #define DISPLAY_DEGREES_STRING "\xDF" @@ -516,80 +315,63 @@ You can tweak these, but read the online documentation! */ -#ifdef FEATURE_4_BIT_LCD_DISPLAY -LiquidCrystal lcd(lcd_4_bit_rs_pin, lcd_4_bit_enable_pin, lcd_4_bit_d4_pin, lcd_4_bit_d5_pin, lcd_4_bit_d6_pin, lcd_4_bit_d7_pin); -#endif //FEATURE_4_BIT_LCD_DISPLAY - - -#ifdef FEATURE_ADAFRUIT_I2C_LCD -Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield(); -#endif //FEATURE_ADAFRUIT_I2C_LCD - -#ifdef FEATURE_YOURDUINO_I2C_LCD -#define I2C_ADDR 0x20 -#define BACKLIGHT_PIN 3 -#define LED_OFF 1 -#define LED_ON 0 -LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); -#endif //FEATURE_YOURDUINO_I2C_LCD - -#ifdef FEATURE_RFROBOT_I2C_DISPLAY -LiquidCrystal_I2C lcd(0x27,16,2); -#endif //FEATURE_RFROBOT_I2C_DISPLAY +#if defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_YWROBOT_I2C_DISPLAY) + K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); +#endif #ifdef FEATURE_AZ_POSITION_HMC5883L -HMC5883L compass; + HMC5883L compass; #endif //FEATURE_AZ_POSITION_HMC5883L #ifdef FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB -ADXL345 accel; + ADXL345 accel; #endif //FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB #ifdef FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB -Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); + Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); #endif //FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB #if defined(FEATURE_EL_POSITION_ADAFRUIT_LSM303) || defined(FEATURE_AZ_POSITION_ADAFRUIT_LSM303) -Adafruit_LSM303 lsm; + Adafruit_LSM303 lsm; #endif #if defined(FEATURE_AZ_POSITION_POLOLU_LSM303) || defined(FEATURE_EL_POSITION_POLOLU_LSM303) -LSM303 compass; -LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; -char report[80]; + LSM303 compass; + LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; + char report[80]; #endif //FEATURE_AZ_POSITION_POLOLU_LSM303 #ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 azimuth_hh12; + #include "hh12.h" + hh12 azimuth_hh12; #endif //FEATURE_AZ_POSITION_HH12_AS5045_SSI #ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 elevation_hh12; + #include "hh12.h" + hh12 elevation_hh12; #endif //FEATURE_EL_POSITION_HH12_AS5045_SSI #ifdef FEATURE_GPS -TinyGPS gps; + TinyGPS gps; #endif //FEATURE_GPS #ifdef FEATURE_RTC_DS1307 -RTC_DS1307 rtc; + RTC_DS1307 rtc; #endif //FEATURE_RTC_DS1307 #ifdef FEATURE_RTC_PCF8583 -PCF8583 rtc(0xA0); + PCF8583 rtc(0xA0); #endif //FEATURE_RTC_PCF8583 #ifdef HARDWARE_EA4TX_ARS_USB -#undef LCD_COLUMNS -#undef LCD_ROWS -#define LCD_COLUMNS 16 -#define LCD_ROWS 2 + #undef LCD_COLUMNS + #undef LCD_ROWS + #define LCD_COLUMNS 16 + #define LCD_ROWS 2 #endif //HARDWARE_EA4TX_ARS_USB #ifdef HARDWARE_M0UPU -#undef LCD_ROWS -#define LCD_ROWS 2 + #undef LCD_ROWS + #define LCD_ROWS 2 #endif //HARDWARE_M0UPU diff --git a/rotator_settings_m0upu.h b/rotator_settings_m0upu.h index d6485ae..9fce864 100755 --- a/rotator_settings_m0upu.h +++ b/rotator_settings_m0upu.h @@ -123,6 +123,15 @@ You can tweak these, but read the online documentation! #define LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define SPLASH_SCREEN_TIME 3000 +#define LCD_HEADING_ROW 2 +#define LCD_HEADING_FIELD_SIZE 20 +#define LCD_STATUS_ROW 1 +#define LCD_STATUS_FIELD_SIZE 20 +#define LCD_DIRECTION_ROW 1 +#define LCD_HHMMSS_CLOCK_ROW 1 +#define LCD_HHMM_CLOCK_ROW 1 +#define PARKING_STATUS_DISPLAY_TIME_MS 5000 + #define AZ_BRAKE_DELAY 3000 // in milliseconds #define EL_BRAKE_DELAY 3000 // in milliseconds @@ -206,216 +215,6 @@ You can tweak these, but read the online documentation! #define SUN_AOS_ELEVATION_MIN 0 #define SUN_AOS_ELEVATION_MAX 180 -#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) -#define MOON_STRING "moon " -#define SUN_STRING "sun " -#define AZ_TARGET_STRING "Az Target " -#define EL_TARGET_STRING "El Target " -#define TARGET_STRING "Target " -#define PARKED_STRING "Parked" -#define ROTATING_CW_STRING "Rotating CW" -#define ROTATING_CCW_STRING "Rotating CCW" -#define ROTATING_TO_STRING "Rotating to " -#define ELEVATING_TO_STRING "Elevating to " -#define ELEVATING_UP_STRING "Elevating Up" -#define ELEVATING_DOWN_STRING "Elevating Down" -#define ROTATING_STRING "Rotating " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "UP" -#define DOWN_STRING "DOWN" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ENGLISH - -#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO -#define MOON_STRING "Luna " -#define SUN_STRING "Sol " -#define AZ_TARGET_STRING "Az Objetivo " -#define EL_TARGET_STRING "El Objetivo " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Aparcado" -#define ROTATING_CW_STRING "Girando Dcha" -#define ROTATING_CCW_STRING "Girando Izq" -#define ROTATING_TO_STRING "Girando a " -#define ELEVATING_TO_STRING "Elevando a " -#define ELEVATING_UP_STRING "Subiendo" -#define ELEVATING_DOWN_STRING "Bajando" -#define ROTATING_STRING "Girando " -#define CW_STRING "Dcha" -#define CCW_STRING "Izq" -#define UP_STRING "Arriba" -#define DOWN_STRING "Abajo" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_SPANISH - -#ifdef LANGUAGE_CZECH // courtesy of Jan, OK2ZAW -#define MOON_STRING "mesic " -#define SUN_STRING "slunce " -#define AZ_TARGET_STRING "Az cíl " -#define EL_TARGET_STRING "El cíl " -#define TARGET_STRING "Cil " -#define PARKED_STRING "Parkovat" -#define ROTATING_CW_STRING "Otacim CW" -#define ROTATING_CCW_STRING "Otacim CCW" -#define ROTATING_TO_STRING "Otacim na " -#define ELEVATING_TO_STRING "Elevovat na " -#define ELEVATING_UP_STRING "Elevovat nahoru" -#define ELEVATING_DOWN_STRING "Elevovat dolu" -#define ROTATING_STRING "Otacet " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "Nahoru" -#define DOWN_STRING "Dolu" -#define AZIMUTH_STRING "Azimut " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "smer ^ KL" -#define W_STRING "smer < HK" -#define S_STRING "smer v ZS" -#define E_STRING "smer > VK" -#define NW_STRING "smer < W" -#define SW_STRING "smer v VP8" -#define SE_STRING "smer > HZ" -#define NE_STRING "smer ^ JA" -#define NNW_STRING "smer ^ VE" -#define WNW_STRING "smer < CO" -#define WSW_STRING "smer < PY" -#define SSW_STRING "smer v ZD9" -#define SSE_STRING "smer v 5R" -#define ESE_STRING "smer > 8Q" -#define ENE_STRING "smer > ZL" -#define NNE_STRING "smer ^ UA0" -#endif //LANGUAGE_CZECH - -#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ -#define MOON_STRING "luna" -#define SUN_STRING "sole " -#define AZ_TARGET_STRING "Punta Az " -#define EL_TARGET_STRING "Punta El " -#define TARGET_STRING "Punta " -#define PARKED_STRING "Posa " -#define ROTATING_CW_STRING "Ruota DX > " -#define ROTATING_CCW_STRING "Ruota SX < " -#define ROTATING_TO_STRING "Ruota verso " -#define ELEVATING_TO_STRING "Alza verso " -#define ELEVATING_UP_STRING "Alzo Su " -#define ELEVATING_DOWN_STRING "Abbasso Giu' " -#define ROTATING_STRING "Ruota " -#define CW_STRING "DX" -#define CCW_STRING "SX " -#define UP_STRING "SU" -#define DOWN_STRING "GIU'" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ITALIAN - -#ifdef LANGUAGE_PORTUGUESE_BRASIL // courtesy of Ismael, PY4PI -#define MOON_STRING "lua " -#define SUN_STRING "sol " -#define AZ_TARGET_STRING "Objetivo Az " -#define EL_TARGET_STRING "Objetivo El " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Estacionado" -#define ROTATING_CW_STRING "Rodando DIR" -#define ROTATING_CCW_STRING "Rodando ESQ" -#define ROTATING_TO_STRING "Rodando para " -#define ELEVATING_TO_STRING "Elevando para " -#define ELEVATING_UP_STRING "Subindo" -#define ELEVATING_DOWN_STRING "Descendo" -#define ROTATING_STRING "Rodando " -#define CW_STRING "DIR" -#define CCW_STRING "ESQ" -#define UP_STRING "SOBE" -#define DOWN_STRING "DESCE" -#define AZIMUTH_STRING "Azimute " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "L" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SL" -#define NE_STRING "NL" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSL" -#define ESE_STRING "LSL" -#define ENE_STRING "LNL" -#define NNE_STRING "NNL" -#endif //LANGUAGE_PORTUGUESE_BRASIL - #define TRACKING_ACTIVE_CHAR "*" #define TRACKING_INACTIVE_CHAR "-" #define DISPLAY_DEGREES_STRING "\xDF" diff --git a/rotator_settings_test.h b/rotator_settings_test.h index 7f5948c..76b5929 100755 --- a/rotator_settings_test.h +++ b/rotator_settings_test.h @@ -1,3 +1,9 @@ +/* + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TEST Hardware !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +*/ /* -------------------------- rotation settings ---------------------------------------*/ @@ -41,7 +47,7 @@ You can tweak these, but read the online documentation! #define SLOW_DOWN_BEFORE_TARGET_AZ 10.0 // if slow down is enabled, slowdown will be activated within this many degrees of target azimuth #define AZ_SLOW_DOWN_PWM_START 200 // starting PWM value for slow down (must be < 256) -#define AZ_SLOW_DOWN_PWM_STOP 20 // ending PWM value for slow down (must be < 256) +#define AZ_SLOW_DOWN_PWM_STOP 20 // ending PWM value for slow down (must be < 256) #define AZ_SLOW_DOWN_STEPS 200 //20 // must be < 256 #define AZ_INITIALLY_IN_SLOW_DOWN_PWM 50 // PWM value to start at if we're starting in the slow down zone (1 - 255) @@ -54,7 +60,7 @@ You can tweak these, but read the online documentation! #define SLOW_DOWN_BEFORE_TARGET_EL 10.0 // if slow down is enabled, slowdown will be activated within this many degrees of target elevation #define EL_SLOW_DOWN_PWM_START 200 // starting PWM value for slow down (must be < 256) -#define EL_SLOW_DOWN_PWM_STOP 20 // ending PWM value for slow down (must be < 256) +#define EL_SLOW_DOWN_PWM_STOP 20 // ending PWM value for slow down (must be < 256) #define EL_SLOW_DOWN_STEPS 20 #define EL_INITIALLY_IN_SLOW_DOWN_PWM 50 // PWM value to start at if we're starting in the slow down zone (1 - 255) @@ -103,16 +109,16 @@ You can tweak these, but read the online documentation! #define GPS_PORT_MAPPED_TO &Serial2 // change this line to map the GPS port to a different serial port //#define GPS_MIRROR_PORT &Serial1 //3 // use this to mirror output from a GPS unit into the Arduino out another port (uncomment to enable) -#define LCD_COLUMNS 16 -#define LCD_ROWS 2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU +#define LCD_COLUMNS 20 //16 +#define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds #define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_ROW 1 -#define LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_POSITION LEFT -#define LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW 1 +#define LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_POSITION CENTER +#define LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW 3 #define LCD_BIG_CLOCK_ROW 4 #define LCD_GPS_INDICATOR_POSITION RIGHT //LEFT or RIGHT #define LCD_GPS_INDICATOR_ROW 1 @@ -123,13 +129,22 @@ You can tweak these, but read the online documentation! #define LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define SPLASH_SCREEN_TIME 3000 +#define LCD_HEADING_ROW 2 +#define LCD_HEADING_FIELD_SIZE 20 +#define LCD_STATUS_ROW 1 +#define LCD_STATUS_FIELD_SIZE 20 +#define LCD_DIRECTION_ROW 1 +#define LCD_HHMMSS_CLOCK_ROW 1 +#define LCD_HHMM_CLOCK_ROW 1 +#define PARKING_STATUS_DISPLAY_TIME_MS 5000 + #define AZ_BRAKE_DELAY 3000 // in milliseconds #define EL_BRAKE_DELAY 3000 // in milliseconds #define BRAKE_ACTIVE_STATE HIGH #define BRAKE_INACTIVE_STATE LOW -#define EEPROM_MAGIC_NUMBER 104 +#define EEPROM_MAGIC_NUMBER 105 #define EEPROM_WRITE_DIRTY_CONFIG_TIME 30 //time in seconds @@ -206,215 +221,7 @@ You can tweak these, but read the online documentation! #define SUN_AOS_ELEVATION_MIN 0 #define SUN_AOS_ELEVATION_MAX 180 -#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) -#define MOON_STRING "moon " -#define SUN_STRING "sun " -#define AZ_TARGET_STRING "Az Target " -#define EL_TARGET_STRING "El Target " -#define TARGET_STRING "Target " -#define PARKED_STRING "Parked" -#define ROTATING_CW_STRING "Rotating CW" -#define ROTATING_CCW_STRING "Rotating CCW" -#define ROTATING_TO_STRING "Rotating to " -#define ELEVATING_TO_STRING "Elevating to " -#define ELEVATING_UP_STRING "Elevating Up" -#define ELEVATING_DOWN_STRING "Elevating Down" -#define ROTATING_STRING "Rotating " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "UP" -#define DOWN_STRING "DOWN" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ENGLISH -#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO -#define MOON_STRING "Luna " -#define SUN_STRING "Sol " -#define AZ_TARGET_STRING "Az Objetivo " -#define EL_TARGET_STRING "El Objetivo " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Aparcado" -#define ROTATING_CW_STRING "Girando Dcha" -#define ROTATING_CCW_STRING "Girando Izq" -#define ROTATING_TO_STRING "Girando a " -#define ELEVATING_TO_STRING "Elevando a " -#define ELEVATING_UP_STRING "Subiendo" -#define ELEVATING_DOWN_STRING "Bajando" -#define ROTATING_STRING "Girando " -#define CW_STRING "Dcha" -#define CCW_STRING "Izq" -#define UP_STRING "Arriba" -#define DOWN_STRING "Abajo" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_SPANISH - -#ifdef LANGUAGE_CZECH // courtesy of Jan, OK2ZAW -#define MOON_STRING "mesic " -#define SUN_STRING "slunce " -#define AZ_TARGET_STRING "Az cíl " -#define EL_TARGET_STRING "El cíl " -#define TARGET_STRING "Cil " -#define PARKED_STRING "Parkovat" -#define ROTATING_CW_STRING "Otacim CW" -#define ROTATING_CCW_STRING "Otacim CCW" -#define ROTATING_TO_STRING "Otacim na " -#define ELEVATING_TO_STRING "Elevovat na " -#define ELEVATING_UP_STRING "Elevovat nahoru" -#define ELEVATING_DOWN_STRING "Elevovat dolu" -#define ROTATING_STRING "Otacet " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "Nahoru" -#define DOWN_STRING "Dolu" -#define AZIMUTH_STRING "Azimut " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "smer ^ KL" -#define W_STRING "smer < HK" -#define S_STRING "smer v ZS" -#define E_STRING "smer > VK" -#define NW_STRING "smer < W" -#define SW_STRING "smer v VP8" -#define SE_STRING "smer > HZ" -#define NE_STRING "smer ^ JA" -#define NNW_STRING "smer ^ VE" -#define WNW_STRING "smer < CO" -#define WSW_STRING "smer < PY" -#define SSW_STRING "smer v ZD9" -#define SSE_STRING "smer v 5R" -#define ESE_STRING "smer > 8Q" -#define ENE_STRING "smer > ZL" -#define NNE_STRING "smer ^ UA0" -#endif //LANGUAGE_CZECH - -#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ -#define MOON_STRING "luna" -#define SUN_STRING "sole " -#define AZ_TARGET_STRING "Punta Az " -#define EL_TARGET_STRING "Punta El " -#define TARGET_STRING "Punta " -#define PARKED_STRING "Posa " -#define ROTATING_CW_STRING "Ruota DX > " -#define ROTATING_CCW_STRING "Ruota SX < " -#define ROTATING_TO_STRING "Ruota verso " -#define ELEVATING_TO_STRING "Alza verso " -#define ELEVATING_UP_STRING "Alzo Su " -#define ELEVATING_DOWN_STRING "Abbasso Giu' " -#define ROTATING_STRING "Ruota " -#define CW_STRING "DX" -#define CCW_STRING "SX " -#define UP_STRING "SU" -#define DOWN_STRING "GIU'" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ITALIAN - -#ifdef LANGUAGE_PORTUGUESE_BRASIL // courtesy of Ismael, PY4PI -#define MOON_STRING "lua " -#define SUN_STRING "sol " -#define AZ_TARGET_STRING "Objetivo Az " -#define EL_TARGET_STRING "Objetivo El " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Estacionado" -#define ROTATING_CW_STRING "Rodando DIR" -#define ROTATING_CCW_STRING "Rodando ESQ" -#define ROTATING_TO_STRING "Rodando para " -#define ELEVATING_TO_STRING "Elevando para " -#define ELEVATING_UP_STRING "Subindo" -#define ELEVATING_DOWN_STRING "Descendo" -#define ROTATING_STRING "Rodando " -#define CW_STRING "DIR" -#define CCW_STRING "ESQ" -#define UP_STRING "SOBE" -#define DOWN_STRING "DESCE" -#define AZIMUTH_STRING "Azimute " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "L" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SL" -#define NE_STRING "NL" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSL" -#define ESE_STRING "LSL" -#define ENE_STRING "LNL" -#define NNE_STRING "NNL" -#endif //LANGUAGE_PORTUGUESE_BRASIL #define TRACKING_ACTIVE_CHAR "*" #define TRACKING_INACTIVE_CHAR "-" @@ -474,8 +281,12 @@ You can tweak these, but read the online documentation! // #define AZIMUTH_CALIBRATION_TO_ARRAY {359,0} -#define ELEVATION_CALIBRATION_FROM_ARRAY {-180,0,180} -#define ELEVATION_CALIBRATION_TO_ARRAY {-180,0,180} +#define ELEVATION_CALIBRATION_FROM_ARRAY {-360,0,360} +#define ELEVATION_CALIBRATION_TO_ARRAY {-360,0,360} + +// example: reverse elevation sensing +//#define ELEVATION_CALIBRATION_FROM_ARRAY {0,180,360} +//#define ELEVATION_CALIBRATION_TO_ARRAY {180,0,-180} #define ANALOG_OUTPUT_MAX_EL_DEGREES 180 @@ -514,90 +325,85 @@ You can tweak these, but read the online documentation! */ -#if !defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) - #if defined(FEATURE_4_BIT_LCD_DISPLAY) - LiquidCrystal lcd(lcd_4_bit_rs_pin, lcd_4_bit_enable_pin, lcd_4_bit_d4_pin, lcd_4_bit_d5_pin, lcd_4_bit_d6_pin, lcd_4_bit_d7_pin); - #endif //FEATURE_4_BIT_LCD_DISPLAY - #ifdef FEATURE_ADAFRUIT_I2C_LCD - Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield(); - #endif //FEATURE_ADAFRUIT_I2C_LCD - - #ifdef FEATURE_YOURDUINO_I2C_LCD - #define I2C_ADDR 0x20 - #define BACKLIGHT_PIN 3 - #define LED_OFF 1 - #define LED_ON 0 - LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); - #endif //FEATURE_YOURDUINO_I2C_LCD - - #ifdef FEATURE_RFROBOT_I2C_DISPLAY - LiquidCrystal_I2C lcd(0x27,16,2); - #endif //FEATURE_RFROBOT_I2C_DISPLAY - - #ifdef FEATURE_YWROBOT_I2C_DISPLAY - #include - #include - LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); - #endif //FEATURE_YWROBOT_I2C_DISPLAY - -#else - K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); -#endif //!defined(UNDER_DEVELOPMENT_K3NGDISPLAY_LIBRARY) +#if defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_YWROBOT_I2C_DISPLAY) + K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); +#endif #ifdef FEATURE_AZ_POSITION_HMC5883L -HMC5883L compass; + HMC5883L compass; #endif //FEATURE_AZ_POSITION_HMC5883L #ifdef FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB -ADXL345 accel; + ADXL345 accel; #endif //FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB #ifdef FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB -Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); + Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); #endif //FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB #if defined(FEATURE_EL_POSITION_ADAFRUIT_LSM303) || defined(FEATURE_AZ_POSITION_ADAFRUIT_LSM303) -Adafruit_LSM303 lsm; + Adafruit_LSM303 lsm; #endif #if defined(FEATURE_AZ_POSITION_POLOLU_LSM303) || defined(FEATURE_EL_POSITION_POLOLU_LSM303) -LSM303 compass; -LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; -char report[80]; + LSM303 compass; + LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; + char report[80]; #endif //FEATURE_AZ_POSITION_POLOLU_LSM303 #ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 azimuth_hh12; + #include "hh12.h" + hh12 azimuth_hh12; #endif //FEATURE_AZ_POSITION_HH12_AS5045_SSI #ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 elevation_hh12; + #include "hh12.h" + hh12 elevation_hh12; #endif //FEATURE_EL_POSITION_HH12_AS5045_SSI #ifdef FEATURE_GPS -TinyGPS gps; + TinyGPS gps; #endif //FEATURE_GPS #ifdef FEATURE_RTC_DS1307 -RTC_DS1307 rtc; + RTC_DS1307 rtc; #endif //FEATURE_RTC_DS1307 #ifdef FEATURE_RTC_PCF8583 -PCF8583 rtc(0xA0); + PCF8583 rtc(0xA0); #endif //FEATURE_RTC_PCF8583 #ifdef HARDWARE_EA4TX_ARS_USB -#undef LCD_COLUMNS -#undef LCD_ROWS -#define LCD_COLUMNS 16 -#define LCD_ROWS 2 + #undef LCD_COLUMNS + #undef LCD_ROWS + #define LCD_COLUMNS 16 + #define LCD_ROWS 2 #endif //HARDWARE_EA4TX_ARS_USB #ifdef HARDWARE_M0UPU -#undef LCD_ROWS -#define LCD_ROWS 2 + #undef LCD_ROWS + #define LCD_ROWS 2 #endif //HARDWARE_M0UPU +#ifdef FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER + #define AZ_A2_ENCODER_RESOLUTION 32767 //36000 + #define AZ_A2_ENCODER_ADDRESS 0x00 + #define AZ_QUERY_FREQUENCY_MS 250 + #define AZ_A2_ENCODER_MODE MODE_TWO_BYTE_POSITION/*|MODE_MULTITURN*/ +#endif //FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER + +#ifdef FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER + #define EL_A2_ENCODER_RESOLUTION 32767 //36000 + #define EL_A2_ENCODER_ADDRESS 0x00 + #define EL_QUERY_FREQUENCY_MS 250 + #define EL_A2_ENCODER_MODE /*MODE_TWO_BYTE_POSITION|*/MODE_MULTITURN +#endif //FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER + +#if defined(FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER) || defined(FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER) + #include "sei_bus.h" + SEIbus SEIbus1(&Serial1,9600,pin_sei_bus_busy,pin_sei_bus_send_receive); + // (Serial Port,Baud Rate,Busy Pin,Send/Receive Pin) + #define SEI_BUS_COMMAND_TIMEOUT_MS 6000 +#endif + diff --git a/rotator_settings_wb6kcn.h b/rotator_settings_wb6kcn.h index d59eb3c..eb41c11 100755 --- a/rotator_settings_wb6kcn.h +++ b/rotator_settings_wb6kcn.h @@ -124,6 +124,15 @@ You can tweak these, but read the online documentation! #define LCD_MOON_OR_SUN_TRACKING_CONDITIONAL_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_OR_SUN_TRACKING_CONDITIONAL #define SPLASH_SCREEN_TIME 3000 +#define LCD_HEADING_ROW 2 +#define LCD_HEADING_FIELD_SIZE 20 +#define LCD_STATUS_ROW 1 +#define LCD_STATUS_FIELD_SIZE 20 +#define LCD_DIRECTION_ROW 1 +#define LCD_HHMMSS_CLOCK_ROW 1 +#define LCD_HHMM_CLOCK_ROW 1 +#define PARKING_STATUS_DISPLAY_TIME_MS 5000 + #define AZ_BRAKE_DELAY 3000 // in milliseconds #define EL_BRAKE_DELAY 3000 // in milliseconds @@ -207,174 +216,6 @@ You can tweak these, but read the online documentation! #define SUN_AOS_ELEVATION_MIN 0 #define SUN_AOS_ELEVATION_MAX 180 -#ifdef LANGUAGE_ENGLISH // English language support (copy leading and trailing spaces when making your own language section) -#define MOON_STRING "moon " -#define SUN_STRING "sun " -#define AZ_TARGET_STRING "Az Target " -#define EL_TARGET_STRING "El Target " -#define TARGET_STRING "Target " -#define PARKED_STRING "Parked" -#define ROTATING_CW_STRING "Rotating CW" -#define ROTATING_CCW_STRING "Rotating CCW" -#define ROTATING_TO_STRING "Rotating to " -#define ELEVATING_TO_STRING "Elevating to " -#define ELEVATING_UP_STRING "Elevating Up" -#define ELEVATING_DOWN_STRING "Elevating Down" -#define ROTATING_STRING "Rotating " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "UP" -#define DOWN_STRING "DOWN" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ENGLISH - -#ifdef LANGUAGE_SPANISH // Courtesy of Maximo, EA1DDO -#define MOON_STRING "Luna " -#define SUN_STRING "Sol " -#define AZ_TARGET_STRING "Az Objetivo " -#define EL_TARGET_STRING "El Objetivo " -#define TARGET_STRING "Objetivo " -#define PARKED_STRING "Aparcado" -#define ROTATING_CW_STRING "Girando Dcha" -#define ROTATING_CCW_STRING "Girando Izq" -#define ROTATING_TO_STRING "Girando a " -#define ELEVATING_TO_STRING "Elevando a " -#define ELEVATING_UP_STRING "Subiendo" -#define ELEVATING_DOWN_STRING "Bajando" -#define ROTATING_STRING "Girando " -#define CW_STRING "Dcha" -#define CCW_STRING "Izq" -#define UP_STRING "Arriba" -#define DOWN_STRING "Abajo" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "O" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NO" -#define SW_STRING "SO" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNO" -#define WNW_STRING "ONO" -#define WSW_STRING "OSO" -#define SSW_STRING "SSO" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_SPANISH - -#ifdef LANGUAGE_CHECK // courtesy of Jan, OK2ZAW -#define MOON_STRING "mesic " -#define SUN_STRING "slunce " -#define AZ_TARGET_STRING "Az cíl " -#define EL_TARGET_STRING "El cíl " -#define TARGET_STRING "Cil " -#define PARKED_STRING "Parkovat" -#define ROTATING_CW_STRING "Otacim CW" -#define ROTATING_CCW_STRING "Otacim CCW" -#define ROTATING_TO_STRING "Otacim na " -#define ELEVATING_TO_STRING "Elevovat na " -#define ELEVATING_UP_STRING "Elevovat nahoru" -#define ELEVATING_DOWN_STRING "Elevovat dolu" -#define ROTATING_STRING "Otacet " -#define CW_STRING "CW" -#define CCW_STRING "CCW" -#define UP_STRING "Nahoru" -#define DOWN_STRING "Dolu" -#define AZIMUTH_STRING "Azimut " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "smer ^ KL" -#define W_STRING "smer < HK" -#define S_STRING "smer v ZS" -#define E_STRING "smer > VK" -#define NW_STRING "smer < W" -#define SW_STRING "smer v VP8" -#define SE_STRING "smer > HZ" -#define NE_STRING "smer ^ JA" -#define NNW_STRING "smer ^ VE" -#define WNW_STRING "smer < CO" -#define WSW_STRING "smer < PY" -#define SSW_STRING "smer v ZD9" -#define SSE_STRING "smer v 5R" -#define ESE_STRING "smer > 8Q" -#define ENE_STRING "smer > ZL" -#define NNE_STRING "smer ^ UA0" -#endif //LANGUAGE_CZECH - -#ifdef LANGUAGE_ITALIAN // courtesy of Paolo, IT9IPQ -#define MOON_STRING "luna" -#define SUN_STRING "sole " -#define AZ_TARGET_STRING "Punta Az " -#define EL_TARGET_STRING "Punta El " -#define TARGET_STRING "Punta " -#define PARKED_STRING "Posa " -#define ROTATING_CW_STRING "Ruota DX > " -#define ROTATING_CCW_STRING "Ruota SX < " -#define ROTATING_TO_STRING "Ruota verso " -#define ELEVATING_TO_STRING "Alza verso " -#define ELEVATING_UP_STRING "Alzo Su " -#define ELEVATING_DOWN_STRING "Alzo Giu' " -#define ROTATING_STRING "Ruota " -#define CW_STRING "DX" -#define CCW_STRING "SX " -#define UP_STRING "SU" -#define DOWN_STRING "GIU'" -#define AZIMUTH_STRING "Azimuth " -#define AZ_STRING "Az" -#define AZ_SPACE_STRING "Az " -#define SPACE_EL_STRING " El" -#define SPACE_EL_SPACE_STRING " El " -#define GPS_STRING "GPS" -#define N_STRING "N" -#define W_STRING "W" -#define S_STRING "S" -#define E_STRING "E" -#define NW_STRING "NW" -#define SW_STRING "SW" -#define SE_STRING "SE" -#define NE_STRING "NE" -#define NNW_STRING "NNW" -#define WNW_STRING "WNW" -#define WSW_STRING "WSW" -#define SSW_STRING "SSW" -#define SSE_STRING "SSE" -#define ESE_STRING "ESE" -#define ENE_STRING "ENE" -#define NNE_STRING "NNE" -#endif //LANGUAGE_ITALIAN - #define TRACKING_ACTIVE_CHAR "*" #define TRACKING_INACTIVE_CHAR "-" #define DISPLAY_DEGREES_STRING "\xDF" @@ -474,78 +315,83 @@ You can tweak these, but read the online documentation! */ - -#ifdef FEATURE_4_BIT_LCD_DISPLAY -LiquidCrystal lcd(lcd_4_bit_rs_pin, lcd_4_bit_enable_pin, lcd_4_bit_d4_pin, lcd_4_bit_d5_pin, lcd_4_bit_d6_pin, lcd_4_bit_d7_pin); -#endif //FEATURE_4_BIT_LCD_DISPLAY - - -#ifdef FEATURE_ADAFRUIT_I2C_LCD -Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield(); -#endif //FEATURE_ADAFRUIT_I2C_LCD - -#ifdef FEATURE_YOURDUINO_I2C_LCD -#define I2C_ADDR 0x20 -#define BACKLIGHT_PIN 3 -#define LED_OFF 1 -#define LED_ON 0 -LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); -#endif //FEATURE_YOURDUINO_I2C_LCD - -#ifdef FEATURE_RFROBOT_I2C_DISPLAY -LiquidCrystal_I2C lcd(0x27,16,2); -#endif //FEATURE_RFROBOT_I2C_DISPLAY +#if defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_YWROBOT_I2C_DISPLAY) + K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); +#endif #ifdef FEATURE_AZ_POSITION_HMC5883L -HMC5883L compass; + HMC5883L compass; #endif //FEATURE_AZ_POSITION_HMC5883L #ifdef FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB -ADXL345 accel; + ADXL345 accel; #endif //FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB #ifdef FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB -Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); + Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); #endif //FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB #if defined(FEATURE_EL_POSITION_ADAFRUIT_LSM303) || defined(FEATURE_AZ_POSITION_ADAFRUIT_LSM303) -Adafruit_LSM303 lsm; + Adafruit_LSM303 lsm; #endif #if defined(FEATURE_AZ_POSITION_POLOLU_LSM303) || defined(FEATURE_EL_POSITION_POLOLU_LSM303) -LSM303 compass; -LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; -char report[80]; + LSM303 compass; + LSM303::vector running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768}; + char report[80]; #endif //FEATURE_AZ_POSITION_POLOLU_LSM303 #ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 azimuth_hh12; + #include "hh12.h" + hh12 azimuth_hh12; #endif //FEATURE_AZ_POSITION_HH12_AS5045_SSI #ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI -#include "hh12.h" -hh12 elevation_hh12; + #include "hh12.h" + hh12 elevation_hh12; #endif //FEATURE_EL_POSITION_HH12_AS5045_SSI #ifdef FEATURE_GPS -TinyGPS gps; + TinyGPS gps; #endif //FEATURE_GPS #ifdef FEATURE_RTC_DS1307 -RTC_DS1307 rtc; + RTC_DS1307 rtc; #endif //FEATURE_RTC_DS1307 #ifdef FEATURE_RTC_PCF8583 -PCF8583 rtc(0xA0); + PCF8583 rtc(0xA0); #endif //FEATURE_RTC_PCF8583 #ifdef HARDWARE_EA4TX_ARS_USB -#undef LCD_COLUMNS -#undef LCD_ROWS -#define LCD_COLUMNS 16 -#define LCD_ROWS 2 + #undef LCD_COLUMNS + #undef LCD_ROWS + #define LCD_COLUMNS 16 + #define LCD_ROWS 2 #endif //HARDWARE_EA4TX_ARS_USB +#ifdef HARDWARE_M0UPU + #undef LCD_ROWS + #define LCD_ROWS 2 +#endif //HARDWARE_M0UPU +#ifdef FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER + #define AZ_A2_ENCODER_RESOLUTION 32767 //36000 + #define AZ_A2_ENCODER_ADDRESS 0x00 + #define AZ_QUERY_FREQUENCY_MS 250 + #define AZ_A2_ENCODER_MODE MODE_TWO_BYTE_POSITION/*|MODE_MULTITURN*/ +#endif //FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER +#ifdef FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER + #define EL_A2_ENCODER_RESOLUTION 32767 //36000 + #define EL_A2_ENCODER_ADDRESS 0x00 + #define EL_QUERY_FREQUENCY_MS 250 + #define EL_A2_ENCODER_MODE /*MODE_TWO_BYTE_POSITION|*/MODE_MULTITURN +#endif //FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER + +#if defined(FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER) || defined(FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER) + #include "sei_bus.h" + SEIbus SEIbus1(&Serial1,9600,pin_sei_bus_busy,pin_sei_bus_send_receive); + // (Serial Port,Baud Rate,Busy Pin,Send/Receive Pin) + #define SEI_BUS_COMMAND_TIMEOUT_MS 6000 +#endif \ No newline at end of file