diff --git a/k3ng_rotator_controller/k3ng_rotator_controller.ino b/k3ng_rotator_controller/k3ng_rotator_controller.ino index d4432bc..f693701 100644 --- a/k3ng_rotator_controller/k3ng_rotator_controller.ino +++ b/k3ng_rotator_controller/k3ng_rotator_controller.ino @@ -31,6 +31,7 @@ Pablo EA4TX Máximo EA1DDO Matt VK5ZM + Baris Dinc TA7W ...and others Translations provided by @@ -307,13 +308,6 @@ 2017.08.14.01 Added \+ command which switched LCD azimuth display mode between normal, raw, and +overlap modes - 2017.09.03.01 - Added auxiliary pins for rotate LEDs: pin_led_cw, pin_led_ccw, pin_led_up, and pin_led_down, and related settings PIN_LED_ACTIVE_STATE, PIN_LED_INACTIVE_STATE - - 2017.09.03.02 - Added pins pin_autopark_disable and pin_autopark_timer_reset for FEATURE_AUTOPARK - - All library files should be placed in directories likes \sketchbook\libraries\library1\ , \sketchbook\libraries\library2\ , etc. Anything rotator_*.* should be in the ino directory! @@ -323,7 +317,7 @@ */ -#define CODE_VERSION "2017.09.03.02" +#define CODE_VERSION "2017.08.14.01" #include #include @@ -355,6 +349,10 @@ #include // required for classic 4 bit interface LCD display (FEATURE_4_BIT_LCD_DISPLAY) #endif // FEATURE_4_BIT_LCD_DISPLAY +#ifdef FEATURE_GLCD_DISPLAY //Graphic LCD support by TA7W + #include +#endif + #if defined(FEATURE_ADAFRUIT_I2C_LCD) #include // required for Adafruit I2C LCD display #include // required for Adafruit I2C LCD display @@ -868,6 +866,8 @@ DebugClass debug; K3NGdisplay k3ngdisplay(LCD_COLUMNS,LCD_ROWS,LCD_UPDATE_TIME); #endif + + #ifdef FEATURE_AZ_POSITION_HMC5883L HMC5883L compass; #endif //FEATURE_AZ_POSITION_HMC5883L @@ -924,6 +924,26 @@ DebugClass debug; #define LCD_ROWS 2 #endif //HARDWARE_M0UPU + +#ifdef FEATURE_GLCD_DISPLAY //initial display settings for TA7W GLCDroutines + #undef LCD_COLUMNS + #undef LCD_ROWS + #define LCD_COLUMNS 16 + #define LCD_ROWS 6 +#endif //TA7W KS108 GLCD support + +#ifdef FEATURE_4x3_KEYPAD //Statemachine definitions for TA7W 4x3Keypad entries + char* KeypadStateIndicator[] = {"Manual","Azimuth","Elevation"}; //used to decide which setting will be changed using keypad, # key changes Elevations/Azimuth selection, after entering TARGET via keypad and pressing * activates heading change + //"M" means Manual Mode, in this mode you can use 2-UP,8-DOWN, 4-LEFT/CCW, 6-RIGHT/CW + int keypad_mode = 0; + int old_KeypadValue = 0; + int az_busy = 0; + int el_busy = 0; + int keypad_digit = 0; + char keypad_target[4] = "000"; +#endif + + #ifdef FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER #define AZ_A2_ENCODER_RESOLUTION 32767 /*36000*/ #define AZ_A2_ENCODER_ADDRESS 0x00 @@ -957,9 +977,6 @@ DebugClass debug; long encoder_pjrc_current_el_position; #endif -#ifdef FEATURE_AUTOPARK - unsigned long last_activity_time_autopark = 0; -#endif /* ------------------ let's start doing some stuff now that we got the formalities out of the way --------------------*/ @@ -2866,6 +2883,65 @@ void check_serial(){ // -------------------------------------------------------------- void check_buttons(){ + #ifdef FEATURE_4x3_KEYPAD //reading keypad and converting to equalivent numbers 1234567890*# (0 is 10, # is 11 and * is 12) (TA7W) + int KeypadValue=0; + digitalWrite(pinA, HIGH); + digitalWrite(pinB, LOW); + digitalWrite(pinC, LOW); + KeypadValue = KeypadValue + 1*digitalRead(pin4)+2*digitalRead(pin3)+3*digitalRead(pin2)+11*digitalRead(pin1); + digitalWrite(pinA, LOW); + digitalWrite(pinB, HIGH); + KeypadValue = KeypadValue + 4*digitalRead(pin4)+5*digitalRead(pin3)+6*digitalRead(pin2)+10*digitalRead(pin1); + digitalWrite(pinB, LOW); + digitalWrite(pinC, HIGH); + KeypadValue = KeypadValue + 7*digitalRead(pin4)+8*digitalRead(pin3)+9*digitalRead(pin2)+12*digitalRead(pin1); + if (KeypadValue != old_KeypadValue) + { + if (KeypadValue == 0) KeypadValue = 99; + if (KeypadValue == 10) KeypadValue = 0; + if (KeypadValue == 11) {keypad_mode = (keypad_mode+1) % 3; keypad_digit = 0;} + old_KeypadValue = KeypadValue; //for debounce + if (keypad_mode == 0) //Manual Mode COntrol + { + if ((KeypadValue == 6) && (az_busy == 0)) {submit_request(AZ, REQUEST_CW, 0, 61); az_busy = 1;} + if ((KeypadValue == 4) && (az_busy == 0)) {submit_request(AZ, REQUEST_CCW, 0, 62); az_busy = 1;} + if ((KeypadValue == 2) && (el_busy == 0)) {submit_request(EL, REQUEST_UP, 0, 66); el_busy = 1;} + if ((KeypadValue == 8) && (el_busy == 0)) {submit_request(EL, REQUEST_DOWN, 0, 67); el_busy = 1;} + if ((KeypadValue == 99) && az_busy) {submit_request(AZ, REQUEST_STOP, 0, 74); az_busy = 0;} + if ((KeypadValue == 99) && el_busy) {submit_request(EL, REQUEST_STOP, 0, 76); el_busy = 0;} + } + if (keypad_mode == 1) //Azimuth Entry + { + if (KeypadValue <= 10) //Azimuth Control + { + keypad_target[keypad_digit]=KeypadValue+48; + keypad_digit=(keypad_digit+1) % 3; + } + if (KeypadValue == 12) submit_request(AZ, REQUEST_AZIMUTH, (((keypad_target[0]-48) * 100 + (keypad_target[1]-48) * 10 + (keypad_target[2]-48)) * HEADING_MULTIPLIER), 28); + } + if (keypad_mode == 2) //Elevation Entry + { + if (KeypadValue <= 10) //Elevation Control + { + keypad_target[keypad_digit]=KeypadValue+48; + keypad_digit=(keypad_digit+1) % 3; + } + if (KeypadValue == 12) submit_request(EL, REQUEST_ELEVATION, ((keypad_target[0]-48) * 100 + (keypad_target[1]-48) * 10 + (keypad_target[2]-48)) , 34); + } + + } //(KeypadValue != old_KeypadValue) + k3ngdisplay.print(KeypadStateIndicator[keypad_mode],0,KEYPAD_ENTRY_DISPLAY_ROW-1); + //char tempchar[2]=""; + //dtostrf(KeypadValue,0,0,tempchar); + //k3ngdisplay.print(tempchar,5,KEYPAD_ENTRY_DISPLAY_ROW-1); + //dtostrf(keypad_mode,0,0,tempchar); + //k3ngdisplay.print(tempchar,8,KEYPAD_ENTRY_DISPLAY_ROW-1); + k3ngdisplay.print(keypad_target,10,KEYPAD_ENTRY_DISPLAY_ROW-1); + k3ngdisplay.service(1); + + #endif + + #ifdef FEATURE_ADAFRUIT_BUTTONS int buttons = 0; // buttons = lcd.readButtons(); @@ -2877,9 +2953,9 @@ void check_buttons(){ #endif // FEATURE_ADAFRUIT_BUTTONS if (azimuth_button_was_pushed == 0) { - #ifdef DEBUG_BUTTONS + // #ifdef DEBUG_BUTTONS debug.println("check_buttons: button_cw pushed"); - #endif // DEBUG_BUTTONS + // #endif // DEBUG_BUTTONS #ifdef OPTION_AZ_MANUAL_ROTATE_LIMITS if (raw_azimuth < (AZ_MANUAL_ROTATE_CW_LIMIT * HEADING_MULTIPLIER)) { #endif @@ -3371,6 +3447,8 @@ void update_display(){ #endif // FEATURE_ELEVATION_CONTROL #endif //defined(OPTION_DISPLAY_HEADING) +//zzzzzzz + // OPTION_DISPLAY_HEADING_AZ_ONLY - show heading *********************************************************************************** #if defined(OPTION_DISPLAY_HEADING_AZ_ONLY) strcpy(workstring,AZIMUTH_STRING); @@ -3511,6 +3589,8 @@ void update_display(){ } #endif // FEATURE_PARK +//zzzzzz + #ifdef FEATURE_AZ_PRESET_ENCODER float target = 0; if (preset_encoders_state == ENCODER_AZ_PENDING) { @@ -4060,6 +4140,7 @@ void update_display(){ static byte big_clock_last_clock_seconds = 0; + //GLCD.SelectFont(fixednums8x16); if (!row_override[LCD_BIG_CLOCK_ROW]){ update_time(); k3ngdisplay.print_center_entire_row(timezone_modified_clock_string(),LCD_BIG_CLOCK_ROW-1,0); @@ -4068,6 +4149,8 @@ void update_display(){ big_clock_last_clock_seconds = clock_seconds; } } + //GLCD.SelectFont(System5x7); + //GLCD.SelectFont(fixednums8x16); #endif //defined(OPTION_DISPLAY_BIG_CLOCK) && defined(FEATURE_CLOCK) @@ -6045,15 +6128,9 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_cw) { digitalWriteEnhanced(rotate_cw, ROTATE_PIN_ACTIVE_VALUE); - #if defined(pin_led_cw) - digitalWriteEnhanced(pin_led_cw, PIN_LED_ACTIVE_STATE); - #endif } if (rotate_ccw) { digitalWriteEnhanced(rotate_ccw, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_ccw) - digitalWriteEnhanced(pin_led_ccw, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_cw_ccw){ digitalWriteEnhanced(rotate_cw_ccw, ROTATE_PIN_ACTIVE_VALUE); @@ -6079,9 +6156,6 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_cw) { digitalWriteEnhanced(rotate_cw, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_cw) - digitalWriteEnhanced(pin_led_cw, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_cw_ccw){ digitalWriteEnhanced(rotate_cw_ccw, ROTATE_PIN_INACTIVE_VALUE); @@ -6157,15 +6231,9 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_cw) { digitalWriteEnhanced(rotate_cw, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_cw) - digitalWriteEnhanced(pin_led_cw, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_ccw) { digitalWriteEnhanced(rotate_ccw, ROTATE_PIN_ACTIVE_VALUE); - #if defined(pin_led_ccw) - digitalWriteEnhanced(pin_led_ccw, PIN_LED_ACTIVE_STATE); - #endif } if (rotate_cw_ccw){ digitalWriteEnhanced(rotate_cw_ccw, ROTATE_PIN_ACTIVE_VALUE); @@ -6205,9 +6273,6 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_ccw) { digitalWriteEnhanced(rotate_ccw, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_ccw) - digitalWriteEnhanced(pin_led_ccw, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_ccw_freq) { noTone(rotate_ccw_freq); @@ -6277,15 +6342,9 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_up) { digitalWriteEnhanced(rotate_up, ROTATE_PIN_ACTIVE_VALUE); - #if defined(pin_led_up) - digitalWriteEnhanced(pin_led_up, PIN_LED_ACTIVE_STATE); - #endif } if (rotate_down) { digitalWriteEnhanced(rotate_down, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_down) - digitalWriteEnhanced(pin_led_down, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_up_or_down) { digitalWriteEnhanced(rotate_up_or_down, ROTATE_PIN_ACTIVE_VALUE); @@ -6315,9 +6374,6 @@ void rotator(byte rotation_action, byte rotation_type) { #endif // DEBUG_ROTATOR if (rotate_up) { digitalWriteEnhanced(rotate_up, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_up) - digitalWriteEnhanced(pin_led_up, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_up_pwm) { analogWriteEnhanced(rotate_up_pwm, 0); digitalWriteEnhanced(rotate_up_pwm, LOW); @@ -6400,15 +6456,9 @@ void rotator(byte rotation_action, byte rotation_type) { } if (rotate_up) { digitalWriteEnhanced(rotate_up, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_up) - digitalWriteEnhanced(pin_led_up, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_down) { digitalWriteEnhanced(rotate_down, ROTATE_PIN_ACTIVE_VALUE); - #if defined(pin_led_down) - digitalWriteEnhanced(pin_led_down, PIN_LED_ACTIVE_STATE); - #endif } if (rotate_up_or_down) { digitalWriteEnhanced(rotate_up_or_down, ROTATE_PIN_ACTIVE_VALUE); @@ -6438,9 +6488,6 @@ void rotator(byte rotation_action, byte rotation_type) { #endif // DEBUG_ROTATOR if (rotate_down) { digitalWriteEnhanced(rotate_down, ROTATE_PIN_INACTIVE_VALUE); - #if defined(pin_led_down) - digitalWriteEnhanced(pin_led_down, PIN_LED_INACTIVE_STATE); - #endif } if (rotate_down_pwm) { analogWriteEnhanced(rotate_down_pwm, 0); digitalWriteEnhanced(rotate_down_pwm, LOW); @@ -6577,25 +6624,6 @@ void initialize_pins(){ pinModeEnhanced(rotate_cw_ccw, OUTPUT); } - #if defined(pin_led_cw) - pinModeEnhanced(pin_led_cw, OUTPUT); - digitalWriteEnhanced(pin_led_cw, PIN_LED_INACTIVE_STATE); - #endif - - #if defined(pin_led_ccw) - pinModeEnhanced(pin_led_ccw, OUTPUT); - digitalWriteEnhanced(pin_led_ccw, PIN_LED_INACTIVE_STATE); - #endif - - #if defined(pin_led_up) - pinModeEnhanced(pin_led_up, OUTPUT); - digitalWriteEnhanced(pin_led_up, PIN_LED_INACTIVE_STATE); - #endif - - #if defined(pin_led_down) - pinModeEnhanced(pin_led_down, OUTPUT); - digitalWriteEnhanced(pin_led_down, PIN_LED_INACTIVE_STATE); - #endif rotator(DEACTIVATE, CW); rotator(DEACTIVATE, CCW); @@ -6679,6 +6707,14 @@ void initialize_pins(){ } #endif // FEATURE_AZ_POSITION_PULSE_INPUT + #ifdef FEATURE_4x3_KEYPAD + pinModeEnhanced(pinA, OUTPUT); + pinModeEnhanced(pinB, OUTPUT); + pinModeEnhanced(pinC, OUTPUT); + pinModeEnhanced(pin1, INPUT); + pinModeEnhanced(pin2, INPUT); + pinModeEnhanced(pin3, INPUT); + #endif #ifdef FEATURE_EL_POSITION_PULSE_INPUT if (el_position_pulse_pin) { @@ -6712,16 +6748,6 @@ void initialize_pins(){ pinModeEnhanced(parked_pin, OUTPUT); digitalWriteEnhanced(parked_pin, LOW); } - #ifdef FEATURE_AUTOPARK - if (pin_autopark_disable) { - pinModeEnhanced(pin_autopark_disable, INPUT); - digitalWriteEnhanced(pin_autopark_disable, HIGH); - } - if (pin_autopark_timer_reset) { - pinModeEnhanced(pin_autopark_timer_reset, INPUT); - digitalWriteEnhanced(pin_autopark_timer_reset, HIGH); - } - #endif //FEATURE_AUTOPARK #endif // FEATURE_PARK if (blink_led) { @@ -7017,18 +7043,18 @@ void initialize_peripherals(){ void submit_request(byte axis, byte request, int parm, byte called_by){ #ifdef DEBUG_SUBMIT_REQUEST - debug.print("submit_request: "); - debug.print(called_by); - debug.print(" "); + debug.print("submit_request: "); + debug.print(called_by); + debug.print(" "); #endif // DEBUG_SUBMIT_REQUEST #ifdef FEATURE_PARK - park_status = NOT_PARKED; + park_status = NOT_PARKED; #endif // FEATURE_PARK if (axis == AZ) { #ifdef DEBUG_SUBMIT_REQUEST - debug.print("AZ "); + debug.print("AZ "); #endif // DEBUG_SUBMIT_REQUEST az_request = request; az_request_parm = parm; @@ -7038,7 +7064,7 @@ void submit_request(byte axis, byte request, int parm, byte called_by){ #ifdef FEATURE_ELEVATION_CONTROL if (axis == EL) { #ifdef DEBUG_SUBMIT_REQUEST - debug.print("EL "); + debug.print("EL "); #endif // DEBUG_SUBMIT_REQUEST el_request = request; el_request_parm = parm; @@ -7047,20 +7073,20 @@ void submit_request(byte axis, byte request, int parm, byte called_by){ #endif // FEATURE_ELEVATION_CONTROL #ifdef DEBUG_SUBMIT_REQUEST - switch(request){ - case 0: debug.print("REQUEST_STOP");break; - case 1: debug.print("REQUEST_AZIMUTH");break; - case 2: debug.print("REQUEST_AZIMUTH_RAW");break; - case 3: debug.print("REQUEST_CW");break; - case 4: debug.print("REQUEST_CCW");break; - case 5: debug.print("REQUEST_UP");break; - case 6: debug.print("REQUEST_DOWN");break; - case 7: debug.print("REQUEST_ELEVATION");break; - case 8: debug.print("REQUEST_KILL");break; - } - debug.print(" "); - debug.print(parm); - debug.println(""); + switch(request){ + case 0: debug.print("REQUEST_STOP");break; + case 1: debug.print("REQUEST_AZIMUTH");break; + case 2: debug.print("REQUEST_AZIMUTH_RAW");break; + case 3: debug.print("REQUEST_CW");break; + case 4: debug.print("REQUEST_CCW");break; + case 5: debug.print("REQUEST_UP");break; + case 6: debug.print("REQUEST_DOWN");break; + case 7: debug.print("REQUEST_ELEVATION");break; + case 8: debug.print("REQUEST_KILL");break; + } + debug.print(" "); + debug.print(parm); + debug.println(""); #endif // DEBUG_SUBMIT_REQUEST } /* submit_request */ @@ -7305,15 +7331,15 @@ void service_rotation(){ #endif // DEBUG_SERVICE_ROTATION #if defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) - if (park_status == PARK_INITIATED) { - park_status = PARKED; - } + if (park_status == PARK_INITIATED) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) #if defined(FEATURE_PARK) && defined(FEATURE_ELEVATION_CONTROL) - if ((park_status == PARK_INITIATED) && (el_state == IDLE)) { - park_status = PARKED; - } + if ((park_status == PARK_INITIATED) && (el_state == IDLE)) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) } @@ -7332,15 +7358,15 @@ void service_rotation(){ #endif // DEBUG_SERVICE_ROTATION #if defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) - if (park_status == PARK_INITIATED) { - park_status = PARKED; - } + if (park_status == PARK_INITIATED) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) #if defined(FEATURE_PARK) && defined(FEATURE_ELEVATION_CONTROL) - if ((park_status == PARK_INITIATED) && (el_state == IDLE)) { - park_status = PARKED; - } + if ((park_status == PARK_INITIATED) && (el_state == IDLE)) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) && !defined(FEATURE_ELEVATION_CONTROL) } @@ -7577,9 +7603,9 @@ read_elevation(0); control_port->println(abs(elevation - target_elevation)); control_port->println();*/ #if defined(FEATURE_PARK) - if ((park_status == PARK_INITIATED) && (az_state == IDLE)) { - park_status = PARKED; - } + if ((park_status == PARK_INITIATED) && (az_state == IDLE)) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) } @@ -7604,9 +7630,9 @@ read_elevation(0); control_port->println(abs(elevation - target_elevation)); control_port->println();*/ #if defined(FEATURE_PARK) - if ((park_status == PARK_INITIATED) && (az_state == IDLE)) { - park_status = PARKED; - } + if ((park_status == PARK_INITIATED) && (az_state == IDLE)) { + park_status = PARKED; + } #endif // defined(FEATURE_PARK) } } @@ -7663,7 +7689,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (az_state != IDLE) { if (az_slowdown_active) { @@ -7712,7 +7738,7 @@ void service_request_queue(){ } if ((target_azimuth > (azimuth - (AZIMUTH_TOLERANCE * HEADING_MULTIPLIER))) && (target_azimuth < (azimuth + (AZIMUTH_TOLERANCE * HEADING_MULTIPLIER)))) { #ifdef DEBUG_SERVICE_REQUEST_QUEUE - debug.print(" request within tolerance"); + debug.print(" request within tolerance"); //zzzzzzzz #endif // DEBUG_SERVICE_REQUEST_QUEUE within_tolerance_flag = 1; // az_request_queue_state = NONE; @@ -7918,12 +7944,12 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (((az_state == SLOW_START_CCW) || (az_state == NORMAL_CCW) || (az_state == SLOW_DOWN_CCW) || (az_state == TIMED_SLOW_DOWN_CCW)) && (az_slowstart_active)) { az_state = INITIALIZE_DIR_CHANGE_TO_CW; #ifdef DEBUG_SERVICE_REQUEST_QUEUE - debug.print(" INITIALIZE_DIR_CHANGE_TO_CW"); + debug.print(" INITIALIZE_DIR_CHANGE_TO_CW"); #endif // DEBUG_SERVICE_REQUEST_QUEUE } else { if ((az_state != SLOW_START_CW) && (az_state != NORMAL_CW)) { @@ -7950,12 +7976,12 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (((az_state == SLOW_START_CW) || (az_state == NORMAL_CW) || (az_state == SLOW_DOWN_CW) || (az_state == TIMED_SLOW_DOWN_CW)) && (az_slowstart_active)) { az_state = INITIALIZE_DIR_CHANGE_TO_CCW; #ifdef DEBUG_SERVICE_REQUEST_QUEUE - debug.print(" INITIALIZE_DIR_CHANGE_TO_CCW"); + debug.print(" INITIALIZE_DIR_CHANGE_TO_CCW"); #endif // DEBUG_SERVICE_REQUEST_QUEUE } else { if ((az_state != SLOW_START_CCW) && (az_state != NORMAL_CCW)) { @@ -7980,7 +8006,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK rotator(DEACTIVATE, CW); rotator(DEACTIVATE, CCW); @@ -8104,7 +8130,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (((el_state == SLOW_START_DOWN) || (el_state == NORMAL_DOWN) || (el_state == SLOW_DOWN_DOWN) || (el_state == TIMED_SLOW_DOWN_DOWN)) && (el_slowstart_active)) { el_state = INITIALIZE_DIR_CHANGE_TO_UP; @@ -8137,7 +8163,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (((el_state == SLOW_START_UP) || (el_state == NORMAL_UP) || (el_state == SLOW_DOWN_UP) || (el_state == TIMED_SLOW_DOWN_UP)) && (el_slowstart_active)) { el_state = INITIALIZE_DIR_CHANGE_TO_DOWN; @@ -8170,7 +8196,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK if (el_state != IDLE) { if (el_slowdown_active) { @@ -8214,7 +8240,7 @@ void service_request_queue(){ #endif // DEBUG_SERVICE_REQUEST_QUEUE stop_all_tracking(); #ifdef FEATURE_PARK - deactivate_park(); + deactivate_park(); #endif // FEATURE_PARK rotator(DEACTIVATE, UP); rotator(DEACTIVATE, DOWN); @@ -9061,7 +9087,7 @@ void deactivate_park(){ void initiate_park(){ #ifdef DEBUG_PARK - debug.print(F("initiate_park: park initiated\n")); + debug.print(F("initiate_park: park initiated\n")); #endif // DEBUG_PARK byte park_initiated = 0; @@ -9072,12 +9098,11 @@ void initiate_park(){ submit_request(AZ, REQUEST_AZIMUTH_RAW, PARK_AZIMUTH, 7); park_initiated = 1; } - #ifdef FEATURE_ELEVATION_CONTROL - if (abs(elevation - PARK_ELEVATION) > (ELEVATION_TOLERANCE * HEADING_MULTIPLIER)) { - submit_request(EL, REQUEST_ELEVATION, PARK_ELEVATION, 8); - park_initiated = 1; - } + if (abs(elevation - PARK_ELEVATION) > (ELEVATION_TOLERANCE * HEADING_MULTIPLIER)) { + submit_request(EL, REQUEST_ELEVATION, PARK_ELEVATION, 8); + park_initiated = 1; + } #endif // FEATURE_ELEVATION_CONTROL if (park_initiated) { @@ -11002,10 +11027,7 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte strcpy(return_string, "Autopark is on, timer: "); dtostrf(configuration.autopark_time_minutes, 0, 0, temp_string); strcat(return_string, temp_string); - strcat(return_string, " minute"); - if (configuration.autopark_time_minutes > 1){ - strcat(return_string, "s"); - } + strcat(return_string, " minutes"); } else { strcpy(return_string, "Autopark is off"); } @@ -11027,7 +11049,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte strcat(return_string, "s"); } configuration.autopark_active = 1; - last_activity_time_autopark = millis(); configuration_dirty = 1; } } else { @@ -11042,7 +11063,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte strcat(return_string, temp_string); strcat(return_string, " minutes"); configuration.autopark_active = 1; - last_activity_time_autopark = millis(); configuration_dirty = 1; } else { strcpy(return_string, "Error"); @@ -11056,7 +11076,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte strcat(return_string, temp_string); strcat(return_string, " minutes"); configuration.autopark_active = 1; - last_activity_time_autopark = millis(); configuration_dirty = 1; } else { strcpy(return_string, "Error"); @@ -11070,7 +11089,6 @@ byte process_backslash_command(byte input_buffer[], int input_buffer_index, byte strcat(return_string, temp_string); strcat(return_string, " minutes"); configuration.autopark_active = 1; - last_activity_time_autopark = millis(); configuration_dirty = 1; } else { strcpy(return_string, "Error"); @@ -13275,7 +13293,7 @@ void test_display(){ char tempchar[12] = ""; int display_number = 1; - + k3ngdisplay.print_top_left("1"); k3ngdisplay.service(1); @@ -13315,46 +13333,20 @@ void test_display(){ void service_autopark(){ - byte autopark_inhibited = 0; + static unsigned long last_activity_time = 0; #if defined(FEATURE_ELEVATION_CONTROL) if ((az_state != IDLE) || (el_state != IDLE) || (park_status == PARKED)){ - last_activity_time_autopark = millis(); + last_activity_time = millis(); } #else if ((az_state != IDLE) || (park_status == PARKED)){ - last_activity_time_autopark = millis(); + last_activity_time = millis(); } #endif - if (pin_autopark_timer_reset){ - if (digitalReadEnhanced(pin_autopark_timer_reset) == LOW){ - last_activity_time_autopark = millis(); - if (park_status == PARK_INITIATED){ - deactivate_park(); - submit_request(AZ, REQUEST_STOP, 0, 85); - #ifdef FEATURE_ELEVATION_CONTROL - submit_request(EL, REQUEST_STOP, 0, 85); - #endif - } - } - } - - if (pin_autopark_disable){ - if (digitalReadEnhanced(pin_autopark_disable) == LOW){ - autopark_inhibited = 1; - last_activity_time_autopark = millis(); - if (park_status == PARK_INITIATED){ - deactivate_park(); - submit_request(AZ, REQUEST_STOP, 0, 86); - #ifdef FEATURE_ELEVATION_CONTROL - submit_request(EL, REQUEST_STOP, 0, 86); - #endif - } - } - } - if ((configuration.autopark_active) && (!autopark_inhibited) && ((millis() - last_activity_time_autopark) > (long(configuration.autopark_time_minutes) * 60000L)) + if ((configuration.autopark_active) && ((millis() - last_activity_time) > (long(configuration.autopark_time_minutes) * 60000L)) && ((park_status != PARK_INITIATED) || (park_status != PARKED))) { #if defined(DEBUG_PARK) debug.print(F("service_autopark: initiating park\n")); @@ -13362,7 +13354,6 @@ void service_autopark(){ initiate_park(); } - } #endif //FEATURE_AUTOPARK diff --git a/k3ng_rotator_controller/rotator_dependencies.h b/k3ng_rotator_controller/rotator_dependencies.h index b0ba31d..ee3b4b6 100755 --- a/k3ng_rotator_controller/rotator_dependencies.h +++ b/k3ng_rotator_controller/rotator_dependencies.h @@ -64,7 +64,7 @@ #define FEATURE_ONE_DECIMAL_PLACE_HEADINGS #endif -#if defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_I2C_LCD) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_RFROBOT_I2C_DISPLAY) || defined(FEATURE_YWROBOT_I2C_DISPLAY) || defined(FEATURE_SAINSMART_I2C_LCD) +#if defined(FEATURE_GLCD_DISPLAY) || defined(FEATURE_4_BIT_LCD_DISPLAY) || defined(FEATURE_I2C_LCD) || defined(FEATURE_ADAFRUIT_I2C_LCD) || defined(FEATURE_YOURDUINO_I2C_LCD) || defined(FEATURE_RFROBOT_I2C_DISPLAY) || defined(FEATURE_YWROBOT_I2C_DISPLAY) || defined(FEATURE_SAINSMART_I2C_LCD) || defined(FEATURE_GLCD_DISPLAY) #define FEATURE_LCD_DISPLAY #endif @@ -126,4 +126,4 @@ - + diff --git a/k3ng_rotator_controller/rotator_features.h b/k3ng_rotator_controller/rotator_features.h old mode 100755 new mode 100644 index e7cb346..c551406 --- a/k3ng_rotator_controller/rotator_features.h +++ b/k3ng_rotator_controller/rotator_features.h @@ -6,20 +6,20 @@ /* main features */ -// #define FEATURE_ELEVATION_CONTROL // uncomment this for AZ/EL rotators +#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_MOON_TRACKING // #define FEATURE_SUN_TRACKING -// #define FEATURE_CLOCK +#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 FEATURE_TEST_DISPLAY_AT_STARTUP +//#define FEATURE_TEST_DISPLAY_AT_STARTUP #define LANGUAGE_ENGLISH // all languages customized in rotator_language.h // #define LANGUAGE_SPANISH @@ -50,7 +50,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_ROTARY_ENCODER_USE_PJRC_LIBRARY // library @ http://www.pjrc.com/teensy/td_libs_Encoder.html // #define FEATURE_EL_POSITION_PULSE_INPUT @@ -63,9 +63,13 @@ // #define FEATURE_EL_POSITION_INCREMENTAL_ENCODER // #define FEATURE_EL_POSITION_MEMSIC_2125 // #define FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER + + +#define FEATURE_4x3_KEYPAD //4x3 Keypad for rotation controlbye TA7W (pin definitiona are in rotator.h) // If you are using an Adafruit, Yourduino, RFRobot, YWRobot, or SainSmart display, you must also change the feature setting in rotator_k3ngdisplay.h!!!! -// #define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) +#define FEATURE_GLCD_DISPLAY //Uncomment for Graphic LCD (TA7W) +//#define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) // #define FEATURE_ADAFRUIT_I2C_LCD // #define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons (also set this feature in rotator_k3ngdisplay.h) // #define FEATURE_YOURDUINO_I2C_LCD @@ -99,7 +103,7 @@ // #define FEATURE_ROTATION_INDICATOR_PIN // activate rotation_indication_pin to indicate rotation // #define FEATURE_LIMIT_SENSE // #define FEATURE_TIMED_BUFFER // Support for Yaesu timed buffer commands -// #define OPTION_SERIAL_HELP_TEXT // Yaesu help command prints help +#define OPTION_SERIAL_HELP_TEXT // Yaesu help command prints help // #define FEATURE_PARK // #define FEATURE_AUTOPARK // Requires FEATURE_PARK // #define OPTION_AZ_MANUAL_ROTATE_LIMITS // this option will automatically stop the L and R commands when hitting a CCW or CW limit (settings are AZ_MANUAL_ROTATE_CCW_LIMIT, AZ_MANUAL_ROTATE_CW_LIMIT) @@ -109,7 +113,7 @@ // #define OPTION_C_COMMAND_SENDS_AZ_AND_EL // uncomment this when using Yaesu emulation with Ham Radio Deluxe // #define OPTION_DELAY_C_CMD_OUTPUT // uncomment this when using Yaesu emulation with Ham Radio Deluxe #define FEATURE_ONE_DECIMAL_PLACE_HEADINGS -// #define FEATURE_TWO_DECIMAL_PLACE_HEADINGS // under development - not working yet! +//#define FEATURE_TWO_DECIMAL_PLACE_HEADINGS // under development - not working yet! // #define FEATURE_AZIMUTH_CORRECTION // correct the azimuth using a calibration table in rotator_settings.h // #define FEATURE_ELEVATION_CORRECTION // correct the elevation using a calibration table in rotator_settings.h // #define FEATURE_ANCILLARY_PIN_CONTROL // control I/O pins with serial commands \F, \N, \P @@ -119,25 +123,25 @@ #define OPTION_EL_SPEED_FOLLOWS_AZ_SPEED // changing the azimith speed with Yaesu X commands or an azimuth speed pot will also change elevation speed // #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_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_HEADING_AZ_ONLY -#define OPTION_DISPLAY_HEADING_EL_ONLY -#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_HEADING_AZ_ONLY +//#define OPTION_DISPLAY_HEADING_EL_ONLY +//#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_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_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_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_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 OPTION_LCD_HEADING_FIELD_FIXED_DECIMAL_PLACE // #define OPTION_REVERSE_AZ_HH12_AS5045 // #define OPTION_REVERSE_EL_HH12_AS5045 @@ -160,22 +164,22 @@ -#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 DEFAULT_DEBUG_STATE 1 // 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_BUTTONS -// #define DEBUG_SERIAL -// #define DEBUG_SERVICE_REQUEST_QUEUE -// #define DEBUG_EEPROM -// #define DEBUG_AZ_SPEED_POT -// #define DEBUG_AZ_PRESET_POT -// #define DEBUG_PRESET_ENCODERS -// #define DEBUG_AZ_MANUAL_ROTATE_LIMITS -// #define DEBUG_EL_MANUAL_ROTATE_LIMITS -// #define DEBUG_BRAKE -// #define DEBUG_OVERLAP -// #define DEBUG_DISPLAY +//#define DEBUG_LOOP +#define DEBUG_BUTTONS +#define DEBUG_SERIAL +#define DEBUG_SERVICE_REQUEST_QUEUE +//#define DEBUG_EEPROM +//#define DEBUG_AZ_SPEED_POT +//#define DEBUG_AZ_PRESET_POT +//#define DEBUG_PRESET_ENCODERS +//#define DEBUG_AZ_MANUAL_ROTATE_LIMITS +//#define DEBUG_EL_MANUAL_ROTATE_LIMITS +//#define DEBUG_BRAKE +//#define DEBUG_OVERLAP +//#define DEBUG_DISPLAY // #define DEBUG_AZ_CHECK_OPERATION_TIMEOUT // #define DEBUG_TIMED_BUFFER // #define DEBUG_EL_CHECK_OPERATION_TIMEOUT diff --git a/k3ng_rotator_controller/rotator_features_TA7W.h b/k3ng_rotator_controller/rotator_features_TA7W.h new file mode 100644 index 0000000..c551406 --- /dev/null +++ b/k3ng_rotator_controller/rotator_features_TA7W.h @@ -0,0 +1,228 @@ +/* ---------------------- Features and Options - you must configure this !! ------------------------------------------------ + + (If you have enabled one of the hardware profiles in rotator_hardware.h, do not edit this file, edit the appropriate files indicated in rotator_hardware.h) + +*/ + +/* 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_RTC_PCF8583 +// #define FEATURE_ETHERNET +// #define FEATURE_STEPPER_MOTOR // requires Mega or an AVR with Timer 5 support +// #define FEATURE_AUTOCORRECT +//#define FEATURE_TEST_DISPLAY_AT_STARTUP + +#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 +// #define LANGUAGE_FRENCH +// #define LANGUAGE_DUTCH + +/* 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 + +// #define FEATURE_MASTER_WITH_SERIAL_SLAVE // [master]{remote_port}<-------serial-------->{control_port}[slave] +// #define FEATURE_MASTER_WITH_ETHERNET_SLAVE // [master]<-------------------ethernet--------------------->[slave] + + +/* position sensors - pick one for azimuth and one for elevation if using an az/el rotator */ +#define FEATURE_AZ_POSITION_POTENTIOMETER //this is used for both a voltage from a rotator control or a homebrew rotator with a potentiometer +// #define FEATURE_AZ_POSITION_ROTARY_ENCODER +// #define FEATURE_AZ_POSITION_ROTARY_ENCODER_USE_PJRC_LIBRARY // library @ http://www.pjrc.com/teensy/td_libs_Encoder.html +// #define FEATURE_AZ_POSITION_PULSE_INPUT +// #define FEATURE_AZ_POSITION_HMC5883L // HMC5883L digital compass support +// #define FEATURE_AZ_POSITION_GET_FROM_REMOTE_UNIT // requires FEATURE_MASTER_WITH_SERIAL_SLAVE or FEATURE_MASTER_WITH_ETHERNET_SLAVE +// #define FEATURE_AZ_POSITION_ADAFRUIT_LSM303 // Uncomment for azimuth using LSM303 compass and Adafruit library (https://github.com/adafruit/Adafruit_LSM303) (also uncomment object declaration below) +// #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 +// #define FEATURE_EL_POSITION_ROTARY_ENCODER_USE_PJRC_LIBRARY // library @ http://www.pjrc.com/teensy/td_libs_Encoder.html +// #define FEATURE_EL_POSITION_PULSE_INPUT +// #define FEATURE_EL_POSITION_ADXL345_USING_LOVE_ELECTRON_LIB // Uncomment for elevation ADXL345 accelerometer support using ADXL345 library +// #define FEATURE_EL_POSITION_ADXL345_USING_ADAFRUIT_LIB // Uncomment for elevation ADXL345 accelerometer support using Adafruit library +// #define FEATURE_EL_POSITION_GET_FROM_REMOTE_UNIT // requires FEATURE_MASTER_WITH_SERIAL_SLAVE or FEATURE_MASTER_WITH_ETHERNET_SLAVE +// #define FEATURE_EL_POSITION_ADAFRUIT_LSM303 // Uncomment for elevation using LSM303 accelerometer and Adafruit library (https://github.com/adafruit/Adafruit_LSM303) (also uncomment object declaration below) +// #define FEATURE_EL_POSITION_POLOLU_LSM303 // Uncomment for elevation using LSM303 compass and Polulu library +// #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_4x3_KEYPAD //4x3 Keypad for rotation controlbye TA7W (pin definitiona are in rotator.h) + +// If you are using an Adafruit, Yourduino, RFRobot, YWRobot, or SainSmart display, you must also change the feature setting in rotator_k3ngdisplay.h!!!! +#define FEATURE_GLCD_DISPLAY //Uncomment for Graphic LCD (TA7W) +//#define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) +// #define FEATURE_ADAFRUIT_I2C_LCD +// #define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons (also set this feature in rotator_k3ngdisplay.h) +// #define FEATURE_YOURDUINO_I2C_LCD +// #define FEATURE_RFROBOT_I2C_DISPLAY +// #define FEATURE_YWROBOT_I2C_DISPLAY +// #define FEATURE_SAINSMART_I2C_LCD + +// #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 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 +//#define OPTION_PRESET_ENCODER_RELATIVE_CHANGE // this makes the encoder(s) change the az or el in a relative fashion rather then store an absolute setting +#define OPTION_PRESET_ENCODER_0_360_DEGREES + +/* position sensor options */ +#define OPTION_AZ_POSITION_ROTARY_ENCODER_HARD_LIMIT // stop azimuth at lower and upper limit rather than rolling over +#define OPTION_EL_POSITION_ROTARY_ENCODER_HARD_LIMIT // stop elevation at lower and upper limits rather than rolling over +#define OPTION_AZ_POSITION_PULSE_HARD_LIMIT // stop azimuth at lower and upper limit rather than rolling over +#define OPTION_EL_POSITION_PULSE_HARD_LIMIT // stop elevation at lower and upper limits rather than rolling over +#define OPTION_POSITION_PULSE_INPUT_PULLUPS // define to enable weak pullups on position pulse inputs + +/* less often used features and options */ +#define OPTION_GS_232B_EMULATION // comment this out to default to Yaesu GS-232A emulation when using FEATURE_YAESU_EMULATION above +// #define FEATURE_ROTATION_INDICATOR_PIN // activate rotation_indication_pin to indicate rotation +// #define FEATURE_LIMIT_SENSE +// #define FEATURE_TIMED_BUFFER // Support for Yaesu timed buffer commands +#define OPTION_SERIAL_HELP_TEXT // Yaesu help command prints help +// #define FEATURE_PARK +// #define FEATURE_AUTOPARK // Requires FEATURE_PARK +// #define OPTION_AZ_MANUAL_ROTATE_LIMITS // this option will automatically stop the L and R commands when hitting a CCW or CW limit (settings are AZ_MANUAL_ROTATE_CCW_LIMIT, AZ_MANUAL_ROTATE_CW_LIMIT) +// #define OPTION_EL_MANUAL_ROTATE_LIMITS // (settings are EL_MANUAL_ROTATE_DOWN_LIMIT, EL_MANUAL_ROTATE_UP_LIMIT) +#define OPTION_EASYCOM_AZ_QUERY_COMMAND // Adds non-standard Easycom command: AZ with no parm returns current azimuth +#define OPTION_EASYCOM_EL_QUERY_COMMAND // Adds non-standard Easycom command: EL with no parm returns current elevation +// #define OPTION_C_COMMAND_SENDS_AZ_AND_EL // uncomment this when using Yaesu emulation with Ham Radio Deluxe +// #define OPTION_DELAY_C_CMD_OUTPUT // uncomment this when using Yaesu emulation with Ham Radio Deluxe +#define FEATURE_ONE_DECIMAL_PLACE_HEADINGS +//#define FEATURE_TWO_DECIMAL_PLACE_HEADINGS // under development - not working yet! +// #define FEATURE_AZIMUTH_CORRECTION // correct the azimuth using a calibration table in rotator_settings.h +// #define FEATURE_ELEVATION_CORRECTION // correct the elevation using a calibration table in rotator_settings.h +// #define FEATURE_ANCILLARY_PIN_CONTROL // control I/O pins with serial commands \F, \N, \P +// #define FEATURE_JOYSTICK_CONTROL // analog joystick support +// #define OPTION_JOYSTICK_REVERSE_X_AXIS +// #define OPTION_JOYSTICK_REVERSE_Y_AXIS +#define OPTION_EL_SPEED_FOLLOWS_AZ_SPEED // changing the azimith speed with Yaesu X commands or an azimuth speed pot will also change elevation speed +// #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_STATUS +#define OPTION_DISPLAY_HEADING +//#define OPTION_DISPLAY_HEADING_AZ_ONLY +//#define OPTION_DISPLAY_HEADING_EL_ONLY +//#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 +// #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 OPTION_REVERSE_AZ_HH12_AS5045 +// #define OPTION_REVERSE_EL_HH12_AS5045 + +// #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 +// #define OPTION_SYNC_MASTER_COORDINATES_TO_SLAVE // use when GPS unit is connected to slave unit and you want to synchronize the master unit coordinates to the slave unit GPS +// #define OPTION_DISABLE_HMC5883L_ERROR_CHECKING +// #define OPTION_HAMLIB_EASYCOM_AZ_EL_COMMAND_HACK +// #define OPTION_HAMLIB_EASYCOM_NO_TERMINATOR_CHARACTER_HACK +// #define OPTION_NO_ELEVATION_CHECK_TARGET_DELAY +// #define OPTION_BLINK_OVERLAP_LED +// #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_EXTENDED_COMMANDS +// #define OPTION_SEND_STRING_OUT_CONTROL_PORT_WHEN_INITIALIZING // change OPTION_SEND_STRING_OUT_CONTROL_PORT_WHEN_INITIALIZING_STRING in settings file + +/* ---------------------- debug stuff - don't touch unless you know what you are doing --------------------------- */ + + + +#define DEFAULT_DEBUG_STATE 1 // 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_BUTTONS +#define DEBUG_SERIAL +#define DEBUG_SERVICE_REQUEST_QUEUE +//#define DEBUG_EEPROM +//#define DEBUG_AZ_SPEED_POT +//#define DEBUG_AZ_PRESET_POT +//#define DEBUG_PRESET_ENCODERS +//#define DEBUG_AZ_MANUAL_ROTATE_LIMITS +//#define DEBUG_EL_MANUAL_ROTATE_LIMITS +//#define DEBUG_BRAKE +//#define DEBUG_OVERLAP +//#define DEBUG_DISPLAY +// #define DEBUG_AZ_CHECK_OPERATION_TIMEOUT +// #define DEBUG_TIMED_BUFFER +// #define DEBUG_EL_CHECK_OPERATION_TIMEOUT +// #define DEBUG_VARIABLE_OUTPUTS +// #define DEBUG_ROTATOR +// #define DEBUG_SUBMIT_REQUEST +// #define DEBUG_SERVICE_ROTATION +// #define DEBUG_POSITION_ROTARY_ENCODER +// #define DEBUG_POSITION_ROTARY_ENCODER_USE_PJRC_LIBRARY +// #define DEBUG_PROFILE_LOOP_TIME +// #define DEBUG_POSITION_PULSE_INPUT +// #define DEBUG_ACCEL +// #define DEBUG_SVC_REMOTE_COMM_INCOMING_BUFFER +// #define DEBUG_SVC_REMOTE_COMM_INCOMING_BUFFER_BAD_DATA +// #define DEBUG_HEADING_READING_TIME +// #define DEBUG_JOYSTICK +// #define DEBUG_ROTATION_INDICATION_PIN +// #define DEBUG_HH12 +// #define DEBUG_PARK +// #define DEBUG_LIMIT_SENSE +// #define DEBUG_AZ_POSITION_INCREMENTAL_ENCODER +// #define DEBUG_EL_POSITION_INCREMENTAL_ENCODER +// #define DEBUG_MOON_TRACKING +// #define DEBUG_SUN_TRACKING +// #define DEBUG_GPS +// #define DEBUG_GPS_SERIAL +// #define DEBUG_OFFSET +// #define DEBUG_RTC +// #define DEBUG_PROCESS_YAESU +// #define DEBUG_ETHERNET +// #define DEBUG_PROCESS_SLAVE +// #define DEBUG_MEMSIC_2125 +// #define DEBUG_SYNC_MASTER_CLOCK_TO_SLAVE +// #define DEBUG_SYNC_MASTER_COORDINATES_TO_SLAVE +// #define DEBUG_HMC5883L +// #define DEBUG_POLOLU_LSM303_CALIBRATION +// #define DEBUG_STEPPER +// #define DEBUG_AUTOCORRECT +// #define DEBUG_A2_ENCODER +// #define DEBUG_A2_ENCODER_LOOPBACK_TEST + + + + + + diff --git a/k3ng_rotator_controller/rotator_features_ea4tx_ars_usb.h b/k3ng_rotator_controller/rotator_features_ea4tx_ars_usb.h index 96ef909..4df50db 100644 --- a/k3ng_rotator_controller/rotator_features_ea4tx_ars_usb.h +++ b/k3ng_rotator_controller/rotator_features_ea4tx_ars_usb.h @@ -1,7 +1,7 @@ /* ---------------------- EA4TX ARS USB Features and Options - you must configure this if using HARDWARE_EA4TX_ARS_USB !! ------------------------------------------------*/ /* main features */ -//#define FEATURE_ELEVATION_CONTROL // uncomment this for AZ/EL rotators +#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) @@ -108,4 +108,4 @@ - + diff --git a/k3ng_rotator_controller/rotator_features_m0upu.h b/k3ng_rotator_controller/rotator_features_m0upu.h index 7119993..ab722d1 100755 --- a/k3ng_rotator_controller/rotator_features_m0upu.h +++ b/k3ng_rotator_controller/rotator_features_m0upu.h @@ -6,7 +6,7 @@ */ /* main features */ -//#define FEATURE_ELEVATION_CONTROL // uncomment this for AZ/EL rotators +#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) @@ -206,4 +206,4 @@ - + diff --git a/k3ng_rotator_controller/rotator_features_test.h b/k3ng_rotator_controller/rotator_features_test.h index fa76e61..941bd65 100755 --- a/k3ng_rotator_controller/rotator_features_test.h +++ b/k3ng_rotator_controller/rotator_features_test.h @@ -16,8 +16,8 @@ #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_MOON_TRACKING +// #define FEATURE_SUN_TRACKING #define FEATURE_CLOCK #define FEATURE_GPS #define FEATURE_RTC_DS1307 @@ -106,7 +106,7 @@ // #define FEATURE_TIMED_BUFFER // Support for Yaesu timed buffer commands #define OPTION_SERIAL_HELP_TEXT // Yaesu help command prints help #define FEATURE_PARK -#define FEATURE_AUTOPARK // Requires FEATURE_PARK +// #define FEATURE_AUTOPARK // Requires FEATURE_PARK #define OPTION_AZ_MANUAL_ROTATE_LIMITS // this option will automatically stop the L and R commands when hitting a CCW or CW limit (settings below - AZ_MANUAL_ROTATE_*_LIMIT) #define OPTION_EL_MANUAL_ROTATE_LIMITS #define OPTION_EASYCOM_AZ_QUERY_COMMAND // Adds non-standard Easycom command: AZ with no parm returns current azimuth @@ -139,7 +139,7 @@ #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_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 diff --git a/k3ng_rotator_controller/rotator_k3ngdisplay.cpp b/k3ng_rotator_controller/rotator_k3ngdisplay.cpp index f3b1ffa..5c78e11 100644 --- a/k3ng_rotator_controller/rotator_k3ngdisplay.cpp +++ b/k3ng_rotator_controller/rotator_k3ngdisplay.cpp @@ -35,7 +35,9 @@ #include #endif - +#ifdef FEATURE_GLCD_DISPLAY //Graphic LCD support by TA7W + #include +#endif #if defined(FEATURE_YOURDUINO_I2C_LCD) #define I2C_ADDR 0x20 @@ -111,9 +113,20 @@ K3NGdisplay::K3NGdisplay(int _display_columns, int _display_rows, int _update_ti void K3NGdisplay::initialize(){ +#ifndef FEATURE_GLCD_DISPLAY lcd.begin(display_columns, display_rows); // if you are getting an error on this line and do not have // any of the LCD display features enabled, remove // k3ngdisplay.h and k3ngdisplay.cpp from your ino directory +#else + GLCD.Init(); + //GLCD.SelectFont(Wendy3x5); //Arial14 Arial_bold_14 CalBlk36 Callibri10 Callibri11 Callibri11_bold Callibri11_italic Callibri14 Callibri15 CalLite24 Cooper19 Cooper21 Cooper26 Corsiva_12 cp437font8x8 fixednums15x31 fixednums7x15 fixednums8x16 + //fixed_bold10x15 font8x8 Iain5x7 lcdnums12x16 lcdnums14x24 newbasic3x5 Roosewood22 Roosewood26 System5x7 SystemFont5x7 TimesNewRoman13 TimesNewRoman13_italic TimesNewRoman16 TimesNewRoman16_bold + //TimesNewRoman16_italic utf8font10x16 Verdana12 Verdana12_bold Verdana12_italic Verdana_digits_24 Wendy3x5 + //GLCD.SelectFont(Callibri10); + GLCD.SelectFont(System5x7); + + +#endif #ifdef FEATURE_YOURDUINO_I2C_LCD lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); @@ -130,7 +143,11 @@ void K3NGdisplay::initialize(){ } //----------------------------------------------------------------------------------------------------- +//Change font support for graphic LCD by TA7W +//void K3NGdisplay::changefont( + +//----------------------------------------------------------------------------------------------------- void K3NGdisplay::service(uint8_t force_update_flag = 0){ @@ -215,7 +232,11 @@ void K3NGdisplay::clear(){ } +#ifdef FEATURE_GLCD_DISPLAY //Display fupport for TA7W + GLCD.ClearScreen(); +#else lcd.clear(); +#endif current_print_row = 0; current_print_column = 0; revert_screen_flag = 0; @@ -258,26 +279,54 @@ void K3NGdisplay::update(){ for (int x = 0;x < (display_columns*display_rows);x++){ if (screen_buffer_live[x] != screen_buffer_pending[x]){ // do we have a new character to put on the screen ? - lcd.setCursor(Xposition(x),Yposition(x)); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.CursorTo(Xposition(x),Yposition(x)); +#else + lcd.setCursor(Xposition(x),Yposition(x)); +#endif if (screen_buffer_attributes_pending[x] & ATTRIBUTE_BLINK){ // does this character have the blink attribute if (current_blink_state){ - lcd.print(screen_buffer_pending[x]); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(screen_buffer_pending[x]); +#else + lcd.print(screen_buffer_pending[x]); +#endif } else { - lcd.print(' '); + #ifdef FEATURE_GLCD_DISPLAY + GLCD.print(' '); +#else + lcd.print(' '); +#endif } } else { - lcd.print(screen_buffer_pending[x]); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(screen_buffer_pending[x]); +#else + lcd.print(screen_buffer_pending[x]); +#endif } screen_buffer_live[x] = screen_buffer_pending[x]; screen_buffer_attributes_live[x] = screen_buffer_attributes_pending[x]; } else { // not a new character, do we have live character on the screen to blink? if (last_blink_state != current_blink_state){ if (screen_buffer_attributes_live[x] & ATTRIBUTE_BLINK){ +#ifdef FEATURE_GLCD_DISPLAY + GLCD.CursorTo(Xposition(x),Yposition(x)); +#else lcd.setCursor(Xposition(x),Yposition(x)); +#endif if (current_blink_state){ +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(screen_buffer_live[x]); +#else lcd.print(screen_buffer_live[x]); +#endif } else { - lcd.print(' '); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(' '); +#else + lcd.print(' '); +#endif } } } @@ -294,15 +343,32 @@ void K3NGdisplay::redraw(){ // redraw the screen with the current screen_buffer_live for (int x = 0;x < (display_columns*display_rows);x++){ +#ifdef FEATURE_GLCD_DISPLAY + GLCD.CursorTo(Xposition(x),Yposition(x)); +#else lcd.setCursor(Xposition(x),Yposition(x)); +#endif + if (screen_buffer_attributes_live[x] & ATTRIBUTE_BLINK){ // does this character have the blink attribute if (current_blink_state){ - lcd.print(screen_buffer_live[x]); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(screen_buffer_live[x]); +#else + lcd.print(screen_buffer_live[x]); +#endif } else { - lcd.print(' '); +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(' '); +#else + lcd.print(' '); +#endif } } else { +#ifdef FEATURE_GLCD_DISPLAY + GLCD.print(screen_buffer_live[x]); +#else lcd.print(screen_buffer_live[x]); +#endif } } @@ -335,7 +401,6 @@ int K3NGdisplay::buffer_index_position(int x,int y){ //----------------------------------------------------------------------------------------------------- void K3NGdisplay::print_attribute(char * print_string, int x, int y, uint8_t attribute){ - for (int print_string_index = 0;print_string_index < (display_columns * display_rows);print_string_index++){ if (print_string[print_string_index] != 0){ if (((buffer_index_position(x,y)+print_string_index)) < (display_columns * display_rows)){ diff --git a/k3ng_rotator_controller/rotator_k3ngdisplay.h b/k3ng_rotator_controller/rotator_k3ngdisplay.h index 511392a..54d7eb1 100644 --- a/k3ng_rotator_controller/rotator_k3ngdisplay.h +++ b/k3ng_rotator_controller/rotator_k3ngdisplay.h @@ -16,13 +16,13 @@ */ -#define FEATURE_4_BIT_LCD_DISPLAY +// #define FEATURE_4_BIT_LCD_DISPLAY // #define FEATURE_ADAFRUIT_I2C_LCD // #define FEATURE_YOURDUINO_I2C_LCD // #define FEATURE_RFROBOT_I2C_DISPLAY // #define FEATURE_YWROBOT_I2C_DISPLAY // #define FEATURE_SAINSMART_I2C_LCD - +#define FEATURE_KS108_GRAPHIC_LCD //Uncomment for Graphic LCD (TA7W) // #define FEATURE_ADAFRUIT_BUTTONS @@ -61,14 +61,22 @@ #include "rotator_pins.h" #endif +#ifdef FEATURE_GLCD_FEATURE //Graphic LCD support by TA7W + #include "rotator_pins_glcd.h" +#endif + #if defined(FEATURE_ADAFRUIT_I2C_LCD) #include "rotator.h" #endif #define K3NG_DISPLAY_LIBRARY_VERSION "1.0.2016032901" -#define MAX_SCREEN_BUFFER_COLUMNS 20 -#define MAX_SCREEN_BUFFER_ROWS 4 - +#ifndef FEATURE_GLCD_DISPLAY //Graphic LCD support by TA7W + #define MAX_SCREEN_BUFFER_COLUMNS 20 + #define MAX_SCREEN_BUFFER_ROWS 4 +#else + #define MAX_SCREEN_BUFFER_COLUMNS 21 + #define MAX_SCREEN_BUFFER_ROWS 8 +#endif #define ATTRIBUTE_BLINK B00000001 #define TEXT_BLINK_MS 500 diff --git a/k3ng_rotator_controller/rotator_pins.h b/k3ng_rotator_controller/rotator_pins.h index 95d6d02..c136ba2 100755 --- a/k3ng_rotator_controller/rotator_pins.h +++ b/k3ng_rotator_controller/rotator_pins.h @@ -18,8 +18,8 @@ #define rotate_cw_ccw_pwm 0 // optional - PWM on CW and CCW output - set to 0 to disable (must be PWM capable pin) #define rotate_cw_freq 0 // optional - CW variable frequency output #define rotate_ccw_freq 0 // optional - CCW variable frequency output -#define button_cw 0 // normally open button to ground for manual CW rotation (schematic pin: A1) -#define button_ccw 0 // normally open button to ground for manual CCW rotation (schematic pin: A2) +#define button_cw A2 // normally open button to ground for manual CW rotation (schematic pin: A1) +#define button_ccw A3 // normally open button to ground for manual CCW rotation (schematic pin: A2) #define serial_led 0 // LED blinks when command is received on serial port (set to 0 to disable) #define rotator_analog_az A0 // reads analog azimuth voltage from rotator - pin 4 on Yaesu connector #define azimuth_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_cw_pwm and rotate_ccw_pwm) @@ -46,8 +46,8 @@ #define rotate_up_freq 0 // optional - UP variable frequency output #define rotate_down_freq 0 // optional - UP variable frequency output #define rotator_analog_el A1 // reads analog elevation voltage from rotator - #define button_up 0 // normally open button to ground for manual up elevation - #define button_down 0 // normally open button to ground for manual down rotation + #define button_up A4 // normally open button to ground for manual up elevation + #define button_down A5 // normally open button to ground for manual down rotation #define brake_el 0 // goes high to disengage elevation brake (set to 0 to disable) #define elevation_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_up_pwm and rotate_down_pwm) #define el_stepper_motor_pulse 0 @@ -97,6 +97,20 @@ #define lcd_4_bit_d7_pin 2 +//4x3 Keypad pin connection definitions +//if defined FEATURE_4x3_KEYPAD in features.h we define the pins here +//TA7W Dec 2017 +#ifdef FEATURE_4x3_KEYPAD + #define pinA 45 //Keypad RAW A ( 1 2 3 # ) + #define pinB 47 //Keypad RAW B ( 4 5 6 0 ) + #define pinC 49 //Keypad RAW C ( 7 8 9 * ) + #define pin1 44 //Keypad COL 1 ( 1 4 7 ) + #define pin2 46 //Keypad COL 2 ( 2 5 8 ) + #define pin3 48 //Keypad COL 3 ( 3 6 9 ) + #define pin4 50 //Keypad COL 4 ( # 0 * ) +#endif + + #ifdef FEATURE_JOYSTICK_CONTROL #define pin_joystick_x A0 #define pin_joystick_y A1 @@ -212,13 +226,3 @@ #define ywrobot_blpol POSITIVE #endif //FEATURE_YWROBOT_I2C_DISPLAY - -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif diff --git a/k3ng_rotator_controller/rotator_pins_TA7W.h b/k3ng_rotator_controller/rotator_pins_TA7W.h new file mode 100755 index 0000000..c136ba2 --- /dev/null +++ b/k3ng_rotator_controller/rotator_pins_TA7W.h @@ -0,0 +1,228 @@ +/* ------------------------------------- Pin Definitions ------------------------------------------ + + You need to look at these and set them appropriately ! + + Most pins can be disabled by setting them to 0 (zero). If you're not using a pin or function, set it to 0. + + Pins > 99 = remote unit pin, for example: pin 109 = pin 9 on remote unit, pin A0+100 = pin A0 on remote unit + +*/ + +/* azimuth pins --------------------- (use just the azimuth pins for an azimuth-only rotator) */ + +#define rotate_cw 6 // goes high to activate rotator R (CW) rotation - pin 1 on Yaesu connector +#define rotate_ccw 7 // goes high to activate rotator L (CCW) rotation - pin 2 on Yaesu connector +#define rotate_cw_ccw 0 // goes high for both CW and CCW rotation +#define rotate_cw_pwm 0 // optional - PWM CW output - set to 0 to disable (must be PWM capable pin) +#define rotate_ccw_pwm 0 // optional - PWM CCW output - set to 0 to disable (must be PWM capable pin) +#define rotate_cw_ccw_pwm 0 // optional - PWM on CW and CCW output - set to 0 to disable (must be PWM capable pin) +#define rotate_cw_freq 0 // optional - CW variable frequency output +#define rotate_ccw_freq 0 // optional - CCW variable frequency output +#define button_cw A2 // normally open button to ground for manual CW rotation (schematic pin: A1) +#define button_ccw A3 // normally open button to ground for manual CCW rotation (schematic pin: A2) +#define serial_led 0 // LED blinks when command is received on serial port (set to 0 to disable) +#define rotator_analog_az A0 // reads analog azimuth voltage from rotator - pin 4 on Yaesu connector +#define azimuth_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_cw_pwm and rotate_ccw_pwm) +#define overlap_led 0 // line goes high when azimuth rotator is in overlap (> 360 rotators) +#define brake_az 0 // goes high to disengage azimuth brake (set to 0 to disable) +#define az_speed_pot 0 // connect to wiper of 1K to 10K potentiometer for speed control (set to 0 to disable) +#define az_preset_pot 0 // connect to wiper of 1K to 10K potentiometer for preset control (set to 0 to disable) +#define preset_start_button 0 // connect to momentary switch (ground on button press) for preset start (set to 0 to disable or for preset automatic start) +#define button_stop 0 // connect to momentary switch (ground on button press) for preset stop (set to 0 to disable or for preset automatic start) +#define rotation_indication_pin 0 +#define blink_led 0 +#define az_stepper_motor_pulse 44 //0 + + + +/*----------- elevation pins --------------*/ +#ifdef FEATURE_ELEVATION_CONTROL + #define rotate_up 8 // goes high to activate rotator elevation up + #define rotate_down 9 // goes high to activate rotator elevation down + #define rotate_up_or_down 0 // goes high when elevation up or down is activated + #define rotate_up_pwm 0 // optional - PWM UP output - set to 0 to disable (must be PWM capable pin) + #define rotate_down_pwm 0 // optional - PWM DOWN output - set to 0 to disable (must be PWM capable pin) + #define rotate_up_down_pwm 0 // optional - PWM on both UP and DOWN (must be PWM capable pin) + #define rotate_up_freq 0 // optional - UP variable frequency output + #define rotate_down_freq 0 // optional - UP variable frequency output + #define rotator_analog_el A1 // reads analog elevation voltage from rotator + #define button_up A4 // normally open button to ground for manual up elevation + #define button_down A5 // normally open button to ground for manual down rotation + #define brake_el 0 // goes high to disengage elevation brake (set to 0 to disable) + #define elevation_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_up_pwm and rotate_down_pwm) + #define el_stepper_motor_pulse 0 +#endif //FEATURE_ELEVATION_CONTROL + +// rotary encoder pins and options +#ifdef FEATURE_AZ_PRESET_ENCODER + #define az_rotary_preset_pin1 0 // CW Encoder Pin + #define az_rotary_preset_pin2 0 // CCW Encoder Pin +#endif //FEATURE_AZ_PRESET_ENCODER + +#ifdef FEATURE_EL_PRESET_ENCODER + #define el_rotary_preset_pin1 0 // UP Encoder Pin + #define el_rotary_preset_pin2 0 // DOWN Encoder Pin +#endif //FEATURE_EL_PRESET_ENCODER + +#if defined(FEATURE_AZ_POSITION_ROTARY_ENCODER) || defined(FEATURE_AZ_POSITION_ROTARY_ENCODER_USE_PJRC_LIBRARY) + #define az_rotary_position_pin1 0 // CW Encoder Pin + #define az_rotary_position_pin2 0 // CCW Encoder Pin +#endif //FEATURE_AZ_POSITION_ROTARY_ENCODER + +#if defined(FEATURE_EL_POSITION_ROTARY_ENCODER) || defined(FEATURE_EL_POSITION_ROTARY_ENCODER_USE_PJRC_LIBRARY) + #define el_rotary_position_pin1 0 // CW Encoder Pin + #define el_rotary_position_pin2 0 // CCW Encoder Pin +#endif //FEATURE_EL_POSITION_ROTARY_ENCODER + +#ifdef FEATURE_AZ_POSITION_PULSE_INPUT + #define az_position_pulse_pin 0 // must be an interrupt capable pin! + #define AZ_POSITION_PULSE_PIN_INTERRUPT 0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#endif // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts + +#ifdef FEATURE_EL_POSITION_PULSE_INPUT + #define el_position_pulse_pin 1 // must be an interrupt capable pin! + #define EL_POSITION_PULSE_PIN_INTERRUPT 1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#endif // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts + +#ifdef FEATURE_PARK + #define button_park 0 +#endif + +//classic 4 bit LCD pins +#define lcd_4_bit_rs_pin 12 +#define lcd_4_bit_enable_pin 11 +#define lcd_4_bit_d4_pin 5 +#define lcd_4_bit_d5_pin 4 +#define lcd_4_bit_d6_pin 3 +#define lcd_4_bit_d7_pin 2 + + +//4x3 Keypad pin connection definitions +//if defined FEATURE_4x3_KEYPAD in features.h we define the pins here +//TA7W Dec 2017 +#ifdef FEATURE_4x3_KEYPAD + #define pinA 45 //Keypad RAW A ( 1 2 3 # ) + #define pinB 47 //Keypad RAW B ( 4 5 6 0 ) + #define pinC 49 //Keypad RAW C ( 7 8 9 * ) + #define pin1 44 //Keypad COL 1 ( 1 4 7 ) + #define pin2 46 //Keypad COL 2 ( 2 5 8 ) + #define pin3 48 //Keypad COL 3 ( 3 6 9 ) + #define pin4 50 //Keypad COL 4 ( # 0 * ) +#endif + + +#ifdef FEATURE_JOYSTICK_CONTROL + #define pin_joystick_x A0 + #define pin_joystick_y A1 +#endif //FEATURE_JOYSTICK_CONTROL + +#ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI + #define az_hh12_clock_pin 11 + #define az_hh12_cs_pin 12 + #define az_hh12_data_pin 13 +#endif //FEATURE_AZ_POSITION_HH_12 + +#ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI + #define el_hh12_clock_pin 53 //11 + #define el_hh12_cs_pin 52 //12 + #define el_hh12_data_pin 51 //13 +#endif //FEATURE_EL_POSITION_HH_12 + +#ifdef FEATURE_PARK + #define park_in_progress_pin 0 // goes high when a park has been initiated and rotation is in progress + #define parked_pin 0 // goes high when in a parked position +#endif //FEATURE_PARK + +#define heading_reading_inhibit_pin 0 // input - a high will cause the controller to suspend taking azimuth (and elevation) readings; use when RF interferes with sensors + +#ifdef FEATURE_LIMIT_SENSE + #define az_limit_sense_pin 0 // input - low stops azimuthal rotation + #define el_limit_sense_pin 0 // input - low stops elevation rotation +#endif //FEATURE_LIMIT_SENSE + +#ifdef FEATURE_AZ_POSITION_INCREMENTAL_ENCODER + #define az_incremental_encoder_pin_phase_a 18 //3 must be an interrupt capable pin + #define az_incremental_encoder_pin_phase_b 19 //3 // must be an interrupt capable pin + #define az_incremental_encoder_pin_phase_z 22 //4 + #define AZ_POSITION_INCREMENTAL_ENCODER_A_PIN_INTERRUPT 5 //0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + #define AZ_POSITION_INCREMENTAL_ENCODER_B_PIN_INTERRUPT 4 //1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts +#endif //FEATURE_AZ_POSITION_INCREMENTAL_ENCODER + +#ifdef FEATURE_EL_POSITION_INCREMENTAL_ENCODER + #define el_incremental_encoder_pin_phase_a 2 //18 //2 // must be an interrupt capable pin + #define el_incremental_encoder_pin_phase_b 3 //19 //3 // must be an interrupt capable pin + #define el_incremental_encoder_pin_phase_z 5 //22 //4 + #define EL_POSITION_INCREMENTAL_ENCODER_A_PIN_INTERRUPT 0 //5 //0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + #define EL_POSITION_INCREMENTAL_ENCODER_B_PIN_INTERRUPT 1 //4 //1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts +#endif //FEATURE_EL_POSITION_INCREMENTAL_ENCODER + +#ifdef FEATURE_YOURDUINO_I2C_LCD + #define En_pin 2 + #define Rw_pin 1 + #define Rs_pin 0 + #define D4_pin 4 + #define D5_pin 5 + #define D6_pin 6 + #define D7_pin 7 +#endif //FEATURE_YOURDUINO_I2C_LCD + +#ifdef FEATURE_MOON_TRACKING + #define moon_tracking_active_pin 0 // goes high when moon tracking is active + #define moon_tracking_activate_line 0 // ground this pin to activate moon tracking (not for use with a button) + #define moon_tracking_button 0 // use with a normally open momentary switch to ground +#endif //FEATURE_MOON_TRACKING + +#ifdef FEATURE_SUN_TRACKING + #define sun_tracking_active_pin 0 // goes high when sun tracking is active + #define sun_tracking_activate_line 0 // ground this pin to activate sun tracking (not for use with a button) + #define sun_tracking_button 0 // use with a normally open momentary switch to ground +#endif //FEATURE_SUN_TRACKING + +#ifdef FEATURE_GPS + #define gps_sync 0 +#endif //FEATURE_GPS + +#ifdef FEATURE_POWER_SWITCH + #define power_switch 0 // use with FEATURE_POWER_SWITCH +#endif //FEATURE_POWER_SWITCH + +#ifdef FEATURE_EL_POSITION_MEMSIC_2125 + #define pin_memsic_2125_x 0 + #define pin_memsic_2125_y 0 +#endif //FEATURE_EL_POSITION_MEMSIC_2125 + +#ifdef FEATURE_ANALOG_OUTPUT_PINS + #define pin_analog_az_out 0 + #define pin_analog_el_out 0 +#endif //FEATURE_ANALOG_OUTPUT_PINS + +#ifdef FEATURE_SUN_PUSHBUTTON_AZ_EL_CALIBRATION + #define pin_sun_pushbutton_calibration 0 // normally HIGH, have button pull LOW +#endif //FEATURE_SUN_PUSHBUTTON_AZ_EL_CALIBRATION + +#ifdef FEATURE_MOON_PUSHBUTTON_AZ_EL_CALIBRATION + #define pin_moon_pushbutton_calibration 0 // normally HIGH, have button pull LOW +#endif //FEATURE_MOON_PUSHBUTTON_AZ_EL_CALIBRATION + +//#define reset_pin 22 // if defined, goes HIGH to reset unit + +#if defined(FEATURE_AZ_POSITION_A2_ABSOLUTE_ENCODER) || defined(FEATURE_EL_POSITION_A2_ABSOLUTE_ENCODER) + #define pin_sei_bus_busy 24 + #define pin_sei_bus_send_receive 22 +#endif + +#ifdef FEATURE_YWROBOT_I2C_DISPLAY + #define ywrobot_address 0x3F + #define ywrobot_pin_en 2 + #define ywrobot_pin_rw 1 + #define ywrobot_pin_rs 0 + #define ywrobot_pin_d4 4 + #define ywrobot_pin_d5 5 + #define ywrobot_pin_d6 6 + #define ywrobot_pin_d7 7 + #define ywrobot_pin_bl 3 + #define ywrobot_blpol POSITIVE +#endif //FEATURE_YWROBOT_I2C_DISPLAY + diff --git a/k3ng_rotator_controller/rotator_pins_ea4tx_ars_usb.h b/k3ng_rotator_controller/rotator_pins_ea4tx_ars_usb.h index 7d5b7d3..4e24f13 100644 --- a/k3ng_rotator_controller/rotator_pins_ea4tx_ars_usb.h +++ b/k3ng_rotator_controller/rotator_pins_ea4tx_ars_usb.h @@ -85,13 +85,3 @@ #define overlap_led 0 // line goes high when azimuth rotator is in overlap (> 360 rotators) #define preset_start_button 0 // connect to momentary switch (ground on button press) for preset start (set to 0 to disable or for preset automatic start) - -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif \ No newline at end of file diff --git a/k3ng_rotator_controller/rotator_pins_glcd.h b/k3ng_rotator_controller/rotator_pins_glcd.h new file mode 100644 index 0000000..a4e8b59 --- /dev/null +++ b/k3ng_rotator_controller/rotator_pins_glcd.h @@ -0,0 +1,50 @@ +/* + * GLCD pins for Graphic LCD support by TA7W Baris + * + * Tested on powertip GLCD pg12864d but can be extended to other GLCDs that are + * supported by openlcd library + * + */ + + + +/* + * all definitions are in the file located at libraries/openGLCD/config/ks0108 or somewhere in config directory + * Please use the related pins for your choice of Arduino board + * + * I placed config for Arduino MEGA for reference, but please check the config directory for mode information + */ + + +//Graphic LCD support by TA7W +// #include +// #include // GLCDv3 compatibilty mode +// #include "fonts/allFonts.h" // system and arial14 fonts are used +// #include "bitmaps/allBitmaps.h" // all images in the bitmap dir + +/* + // Data pin definitions +// This version uses pins 22-29 for LCD Data + +#define glcdPinData0 22 +#define glcdPinData1 23 +#define glcdPinData2 24 +#define glcdPinData3 25 +#define glcdPinData4 26 +#define glcdPinData5 27 +#define glcdPinData6 28 +#define glcdPinData7 29 + + +// Pins used for Control + +#define glcdPinCSEL1 33 // CS1 Bit +#define glcdPinCSEL2 34 // CS2 Bit +#define glcdPinRW 35 // R/W Bit +#define glcdPinDI 36 // D/I Bit +#define glcdPinEN 37 // EN Bit + +*/ + + + diff --git a/k3ng_rotator_controller/rotator_pins_k3ng_g1000.h b/k3ng_rotator_controller/rotator_pins_k3ng_g1000.h index b20a1e6..4c0af49 100755 --- a/k3ng_rotator_controller/rotator_pins_k3ng_g1000.h +++ b/k3ng_rotator_controller/rotator_pins_k3ng_g1000.h @@ -167,13 +167,3 @@ #define gps_sync 0 #endif //FEATURE_GPS - -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif diff --git a/k3ng_rotator_controller/rotator_pins_m0upu.h b/k3ng_rotator_controller/rotator_pins_m0upu.h index 3f0b98c..770db93 100644 --- a/k3ng_rotator_controller/rotator_pins_m0upu.h +++ b/k3ng_rotator_controller/rotator_pins_m0upu.h @@ -180,12 +180,3 @@ #define pin_memsic_2125_y 0 #endif //FEATURE_EL_POSITION_MEMSIC_2125 -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif diff --git a/k3ng_rotator_controller/rotator_pins_test.h b/k3ng_rotator_controller/rotator_pins_test.h index 4ac6f38..53e9f66 100644 --- a/k3ng_rotator_controller/rotator_pins_test.h +++ b/k3ng_rotator_controller/rotator_pins_test.h @@ -222,13 +222,3 @@ #define ywrobot_blpol POSITIVE #endif //FEATURE_YWROBOT_I2C_DISPLAY - -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif diff --git a/k3ng_rotator_controller/rotator_pins_wb6kcn.h b/k3ng_rotator_controller/rotator_pins_wb6kcn.h index f087f1d..a3c84e4 100755 --- a/k3ng_rotator_controller/rotator_pins_wb6kcn.h +++ b/k3ng_rotator_controller/rotator_pins_wb6kcn.h @@ -199,12 +199,4 @@ #endif //FEATURE_YWROBOT_I2C_DISPLAY -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif + diff --git a/k3ng_rotator_controller/rotator_pins_wb6kcn_az_test_setup.h b/k3ng_rotator_controller/rotator_pins_wb6kcn_az_test_setup.h index 817dc56..4be061b 100755 --- a/k3ng_rotator_controller/rotator_pins_wb6kcn_az_test_setup.h +++ b/k3ng_rotator_controller/rotator_pins_wb6kcn_az_test_setup.h @@ -191,13 +191,4 @@ #endif //FEATURE_ANALOG_OUTPUT_PINS -// #define pin_led_cw 0 -// #define pin_led_ccw 0 -// #define pin_led_up 0 -// #define pin_led_down 0 - -#ifdef FEATURE_AUTOPARK - #define pin_autopark_disable 0 // Pull low to disable autopark - #define pin_autopark_timer_reset 0 // Pull low to reset the autopark timer (tie in with rig PTT) -#endif diff --git a/k3ng_rotator_controller/rotator_settings.h b/k3ng_rotator_controller/rotator_settings.h old mode 100755 new mode 100644 index 2b5b096..67a8d04 --- a/k3ng_rotator_controller/rotator_settings.h +++ b/k3ng_rotator_controller/rotator_settings.h @@ -1,8 +1,8 @@ /* -------------------------- rotation settings ---------------------------------------*/ -#define AZIMUTH_STARTING_POINT_DEFAULT 180 // the starting point in degrees of the azimuthal rotator - only used for initializing EEPROM the first time the code is run -#define AZIMUTH_ROTATION_CAPABILITY_DEFAULT 450 // the default rotation capability of the rotator in degrees - only used for initializing EEPROM the first time the code is run +#define AZIMUTH_STARTING_POINT_DEFAULT 0 // the starting point in degrees of the azimuthal rotator - only used for initializing EEPROM the first time the code is run +#define AZIMUTH_ROTATION_CAPABILITY_DEFAULT 360 // the default rotation capability of the rotator in degrees - only used for initializing EEPROM the first time the code is run /* @@ -16,7 +16,7 @@ \Q - Save settings in the EEPROM and restart */ -#define ELEVATION_MAXIMUM_DEGREES 180 // change this to set the maximum elevation in degrees +#define ELEVATION_MAXIMUM_DEGREES 72 // change this to set the maximum elevation in degrees /* --------------------------- Settings ------------------------------------------------ @@ -28,7 +28,7 @@ You can tweak these, but read the online documentation! #define ANALOG_AZ_FULL_CCW 4 #define ANALOG_AZ_FULL_CW 1009 #define ANALOG_EL_0_DEGREES 2 -#define ANALOG_EL_MAX_ELEVATION 1018 // maximum elevation is normally 180 degrees unless change below for ELEVATION_MAXIMUM_DEGREES +#define ANALOG_EL_MAX_ELEVATION 911 // maximum elevation is normally 180 degrees unless change below for ELEVATION_MAXIMUM_DEGREES #define ANALOG_AZ_OVERLAP_DEGREES 540 // if overlap_led above is enabled, turn on overlap led line if azimuth is greater than this setting // you must use raw azimuth (if the azimuth on the rotator crosses over to 0 degrees, add 360 @@ -102,7 +102,7 @@ You can tweak these, but read the online documentation! // various code settings #define AZIMUTH_TOLERANCE 3.0 // rotator will stop within X degrees when doing autorotation #define ELEVATION_TOLERANCE 0.1 //1.0 -#define OPERATION_TIMEOUT 120000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#define OPERATION_TIMEOUT 240000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down #define TIMED_INTERVAL_ARRAY_SIZE 20 #define CONTROL_PORT_BAUD_RATE 9600 @@ -115,8 +115,14 @@ You can tweak these, but read the online documentation! //#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 OPTION_SEND_STRING_OUT_CONTROL_PORT_WHEN_INITIALIZING_STRING ("test\n\r") -#define LCD_COLUMNS 20 //16 -#define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU +#ifndef FEATURE_GLCD_DISPLAY //GLCD support by TA7W + #define LCD_COLUMNS 20 //16 + #define LCD_ROWS 2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU +#else + #define LCD_COLUMNS 21 + #define LCD_ROWS 8 + #define KEYPAD_ENTRY_DISPLAY_ROW 5 //Display Keypad entries and status on row 6 +#endif #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT @@ -124,7 +130,7 @@ You can tweak these, but read the online documentation! #define LCD_ALT_HHMM_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_BIG_CLOCK_ROW 6 #define LCD_GPS_INDICATOR_POSITION RIGHT //LEFT or RIGHT #define LCD_GPS_INDICATOR_ROW 1 #define LCD_MOON_TRACKING_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY @@ -214,8 +220,8 @@ You can tweak these, but read the online documentation! #define SERIAL_LED_TIME_MS 250 -#define DEFAULT_LATITUDE 40.889958 -#define DEFAULT_LONGITUDE -75.585972 +#define DEFAULT_LATITUDE 39.9375 //40.889958 +#define DEFAULT_LONGITUDE 32.7917 //-75.585972 #define MOON_TRACKING_CHECK_INTERVAL 5000 #define MOON_AOS_AZIMUTH_MIN 0 @@ -323,6 +329,3 @@ You can tweak these, but read the online documentation! #define AUTOCORRECT_TIME_MS_AZ 1000 #define AUTOCORRECT_TIME_MS_EL 1000 - -#define PIN_LED_ACTIVE_STATE HIGH -#define PIN_LED_INACTIVE_STATE LOW diff --git a/k3ng_rotator_controller/rotator_settings_TA7W.h b/k3ng_rotator_controller/rotator_settings_TA7W.h new file mode 100644 index 0000000..67a8d04 --- /dev/null +++ b/k3ng_rotator_controller/rotator_settings_TA7W.h @@ -0,0 +1,331 @@ + +/* -------------------------- rotation settings ---------------------------------------*/ + +#define AZIMUTH_STARTING_POINT_DEFAULT 0 // the starting point in degrees of the azimuthal rotator - only used for initializing EEPROM the first time the code is run +#define AZIMUTH_ROTATION_CAPABILITY_DEFAULT 360 // the default rotation capability of the rotator in degrees - only used for initializing EEPROM the first time the code is run + +/* + + Use these commands to change the azimuth starting point and rotation capability if you have already ran the code one which would have + initialized the EEPROM: + + \Ix[x][x] - set az starting point + \I - display the current az starting point + \Jx[x][x] - set az rotation capability + \J - display the current az rotation capability + \Q - Save settings in the EEPROM and restart +*/ + +#define ELEVATION_MAXIMUM_DEGREES 72 // change this to set the maximum elevation in degrees + +/* --------------------------- Settings ------------------------------------------------ + +You can tweak these, but read the online documentation! + +*/ + +// analog voltage calibration - these are default values; you can either tweak these or set via the Yaesu O and F commands (and O2 and F2).... +#define ANALOG_AZ_FULL_CCW 4 +#define ANALOG_AZ_FULL_CW 1009 +#define ANALOG_EL_0_DEGREES 2 +#define ANALOG_EL_MAX_ELEVATION 911 // maximum elevation is normally 180 degrees unless change below for ELEVATION_MAXIMUM_DEGREES + +#define ANALOG_AZ_OVERLAP_DEGREES 540 // if overlap_led above is enabled, turn on overlap led line if azimuth is greater than this setting + // you must use raw azimuth (if the azimuth on the rotator crosses over to 0 degrees, add 360 + // for example, on a Yaesu 450 degree rotator with a starting point of 180 degrees, and an overlap LED + // turning on when going CW and crossing 180, ANALOG_AZ_OVERLAP_DEGREES should be set for 540 (180 + 360) +#define OPTION_OVERLAP_LED_BLINK_MS 100 + +// PWM speed voltage settings +#define PWM_SPEED_VOLTAGE_X1 64 // 0 to 255 +#define PWM_SPEED_VOLTAGE_X2 128 // 0 to 255 +#define PWM_SPEED_VOLTAGE_X3 191 // 0 to 255 +#define PWM_SPEED_VOLTAGE_X4 253 // 0 to 255 + +//AZ +#define AZ_SLOWSTART_DEFAULT 0 // 0 = off ; 1 = on +#define AZ_SLOWDOWN_DEFAULT 0 // 0 = off ; 1 = on +#define AZ_SLOW_START_UP_TIME 2000 // if slow start is enabled, the unit will ramp up speed for this many milliseconds +#define AZ_SLOW_START_STARTING_PWM 1 // PWM starting value for slow start (must be < 256) +#define AZ_SLOW_START_STEPS 20 // must be < 256 + + +#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_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) + +//EL +#define EL_SLOWSTART_DEFAULT 0 // 0 = off ; 1 = on +#define EL_SLOWDOWN_DEFAULT 0 // 0 = off ; 1 = on +#define EL_SLOW_START_UP_TIME 2000 // if slow start is enabled, the unit will ramp up speed for this many milliseconds +#define EL_SLOW_START_STARTING_PWM 1 // PWM starting value for slow start (must be < 256) +#define EL_SLOW_START_STEPS 20 // must be < 256 + +#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_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) + +#define TIMED_SLOW_DOWN_TIME 2000 + +//Variable frequency output settings - LOWEST FREQUENCY IS 31 HERTZ DUE TO ARDUINO tone() FUNCTION LIMITATIONS! +#define AZ_VARIABLE_FREQ_OUTPUT_LOW 31 // Frequency in hertz of minimum speed +#define AZ_VARIABLE_FREQ_OUTPUT_HIGH 5000 //100 // Frequency in hertz of maximum speed +#define EL_VARIABLE_FREQ_OUTPUT_LOW 31 // Frequency in hertz of minimum speed +#define EL_VARIABLE_FREQ_OUTPUT_HIGH 100 // Frequency in hertz of maximum speed + +// Settings for OPTION_AZ_MANUAL_ROTATE_LIMITS +#define AZ_MANUAL_ROTATE_CCW_LIMIT 0 // if using a rotator that starts at 180 degrees, set this to something like 185 +#define AZ_MANUAL_ROTATE_CW_LIMIT 535 // add 360 to this if you go past 0 degrees (i.e. 180 CW after 0 degrees = 540) + +// Settings for OPTION_EL_MANUAL_ROTATE_LIMITS +#define EL_MANUAL_ROTATE_DOWN_LIMIT -1 +#define EL_MANUAL_ROTATE_UP_LIMIT 181 + +// Speed pot settings +#define SPEED_POT_LOW 0 +#define SPEED_POT_HIGH 1023 +#define SPEED_POT_LOW_MAP 1 +#define SPEED_POT_HIGH_MAP 255 + +// Azimuth preset pot settings +#define AZ_PRESET_POT_FULL_CW 0 +#define AZ_PRESET_POT_FULL_CCW 1023 +#define AZ_PRESET_POT_FULL_CW_MAP 180 // azimuth pot fully counter-clockwise degrees +#define AZ_PRESET_POT_FULL_CCW_MAP 630 // azimuth pot fully clockwise degrees + +#define ENCODER_PRESET_TIMEOUT 5000 + +// various code settings +#define AZIMUTH_TOLERANCE 3.0 // rotator will stop within X degrees when doing autorotation +#define ELEVATION_TOLERANCE 0.1 //1.0 +#define OPERATION_TIMEOUT 240000 // timeout for any rotation operation in mS ; 120 seconds is usually enough unless you have the speed turned down +#define TIMED_INTERVAL_ARRAY_SIZE 20 + +#define CONTROL_PORT_BAUD_RATE 9600 +#define REMOTE_UNIT_PORT_BAUD_RATE 9600 +#define GPS_PORT_BAUD_RATE 9600 +#define GPS_MIRROR_PORT_BAUD_RATE 9600 +#define CONTROL_PORT_MAPPED_TO &Serial // change this line to map the control port to a different serial port (Serial1, Serial2, etc.) +//#define REMOTE_PORT_MAPPED_TO &Serial1 // change this line to map the remote_unit port to a different serial port +#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 OPTION_SEND_STRING_OUT_CONTROL_PORT_WHEN_INITIALIZING_STRING ("test\n\r") + +#ifndef FEATURE_GLCD_DISPLAY //GLCD support by TA7W + #define LCD_COLUMNS 20 //16 + #define LCD_ROWS 2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU +#else + #define LCD_COLUMNS 21 + #define LCD_ROWS 8 + #define KEYPAD_ENTRY_DISPLAY_ROW 5 //Display Keypad entries and status on row 6 +#endif +#define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds +#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 CENTER +#define LCD_CONSTANT_HHMMSS_CLOCK_AND_MAIDENHEAD_ROW 3 +#define LCD_BIG_CLOCK_ROW 6 +#define LCD_GPS_INDICATOR_POSITION RIGHT //LEFT or RIGHT +#define LCD_GPS_INDICATOR_ROW 1 +#define LCD_MOON_TRACKING_ROW 3 // LCD display row for OPTION_DISPLAY_MOON_TRACKING_CONTINUOUSLY +#define LCD_MOON_TRACKING_UPDATE_INTERVAL 5000 +#define LCD_SUN_TRACKING_ROW 4 // LCD display row for OPTION_DISPLAY_SUN_TRACKING_CONTINUOUSLY +#define LCD_SUN_TRACKING_UPDATE_INTERVAL 5000 +#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_AZ_ONLY_HEADING_ROW 1 +#define LCD_AZ_ONLY_HEADING_FIELD_SIZE 20 +#define LCD_EL_ONLY_HEADING_ROW 2 +#define LCD_EL_ONLY_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 109 +#define EEPROM_WRITE_DIRTY_CONFIG_TIME 30 //time in seconds + + +#if defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) +#define HEADING_MULTIPLIER 100L +#define LCD_HEADING_MULTIPLIER 100.0 +#define LCD_DECIMAL_PLACES 2 +#endif //FEATURE_TWO_DECIMAL_PLACE_HEADINGS + +#if defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) +#define HEADING_MULTIPLIER 10 +#define LCD_HEADING_MULTIPLIER 10.0 +#define LCD_DECIMAL_PLACES 1 +#endif //FEATURE_ONE_DECIMAL_PLACE_HEADINGS + +#if !defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) && !defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) +#define HEADING_MULTIPLIER 1 +#define LCD_HEADING_MULTIPLIER 1.0 +#define LCD_DECIMAL_PLACES 0 +#endif //!defined(FEATURE_ONE_DECIMAL_PLACE_HEADINGS) && !defined(FEATURE_TWO_DECIMAL_PLACE_HEADINGS) + +#define AZ_POSITION_ROTARY_ENCODER_DEG_PER_PULSE 0.5 +#define EL_POSITION_ROTARY_ENCODER_DEG_PER_PULSE 0.5 + +#define AZ_POSITION_PULSE_DEG_PER_PULSE 0.5 +#define EL_POSITION_PULSE_DEG_PER_PULSE 0.5 + +#define PARK_AZIMUTH 360.0 * HEADING_MULTIPLIER // replace the 0.0 with your park azimuth; azimuth is in raw degrees (i.e. on a 180 degree starting point rotator, 0 degrees = 360) +#define PARK_ELEVATION 0.0 * HEADING_MULTIPLIER // replace the 0.0 with your park elevation + +#define COMMAND_BUFFER_SIZE 50 + +#define REMOTE_BUFFER_TIMEOUT_MS 250 +#define REMOTE_UNIT_COMMAND_TIMEOUT_MS 2000 +#define AZ_REMOTE_UNIT_QUERY_TIME_MS 150 // how often we query the remote remote for azimuth +#define EL_REMOTE_UNIT_QUERY_TIME_MS 150 // how often we query the remote remote for elevation + +#define ROTATE_PIN_INACTIVE_VALUE LOW +#define ROTATE_PIN_ACTIVE_VALUE HIGH + +#define AZIMUTH_SMOOTHING_FACTOR 0 // value = 0 to 99.9 +#define ELEVATION_SMOOTHING_FACTOR 0 // value = 0 to 99.9 + +#define AZIMUTH_MEASUREMENT_FREQUENCY_MS 100 // this does not apply if using FEATURE_AZ_POSITION_GET_FROM_REMOTE_UNIT +#define ELEVATION_MEASUREMENT_FREQUENCY_MS 100 // this does not apply if using FEATURE_EL_POSITION_GET_FROM_REMOTE_UNIT + +#define JOYSTICK_WAIT_TIME_MS 100 + +#define ROTATION_INDICATOR_PIN_ACTIVE_STATE HIGH +#define ROTATION_INDICATOR_PIN_INACTIVE_STATE LOW +#define ROTATION_INDICATOR_PIN_TIME_DELAY_SECONDS 0 +#define ROTATION_INDICATOR_PIN_TIME_DELAY_MINUTES 0 + +#define AZ_POSITION_INCREMENTAL_ENCODER_PULSES_PER_REV 2000.0 +#define EL_POSITION_INCREMENTAL_ENCODER_PULSES_PER_REV 2000.0 +#define AZ_INCREMENTAL_ENCODER_ZERO_PULSE_POSITION 0 // can be 0 to 4 x AZ_POSITION_INCREMENTAL_ENCODER_PULSES_PER_REV +#define EL_INCREMENTAL_ENCODER_ZERO_PULSE_POSITION 0 // can be 0 to 4 x EL_POSITION_INCREMENTAL_ENCODER_PULSES_PER_REV + +#define SERIAL_LED_TIME_MS 250 + +#define DEFAULT_LATITUDE 39.9375 //40.889958 +#define DEFAULT_LONGITUDE 32.7917 //-75.585972 + +#define MOON_TRACKING_CHECK_INTERVAL 5000 +#define MOON_AOS_AZIMUTH_MIN 0 +#define MOON_AOS_AZIMUTH_MAX 360 +#define MOON_AOS_ELEVATION_MIN 0 +#define MOON_AOS_ELEVATION_MAX 180 + + +#define SUN_TRACKING_CHECK_INTERVAL 5000 +#define SUN_AOS_AZIMUTH_MIN 0 +#define SUN_AOS_AZIMUTH_MAX 360 +#define SUN_AOS_ELEVATION_MIN 0 +#define SUN_AOS_ELEVATION_MAX 180 + + + +#define TRACKING_ACTIVE_CHAR "*" +#define TRACKING_INACTIVE_CHAR "-" +#define DISPLAY_DEGREES_STRING "\xDF" + +#define INTERNAL_CLOCK_CORRECTION 0.00145 + +#define SYNC_TIME_WITH_GPS 1 +#define SYNC_COORDINATES_WITH_GPS 1 +#define GPS_SYNC_PERIOD_SECONDS 10 // how long to consider internal clock syncronized after a GPS reading +#define GPS_VALID_FIX_AGE_MS 10000 // consider a GPS reading valid if the fix age is less than this +#define GPS_UPDATE_LATENCY_COMPENSATION_MS 200 + +#define SYNC_WITH_RTC_SECONDS 59 // syncronize internal clock with realtime clock every x seconds +#define SYNC_RTC_TO_GPS_SECONDS 12 // synchronize realtime clock to GPS every x seconds + +#define SYNC_MASTER_CLOCK_TO_SLAVE_CLOCK_SECS 10 // for 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 clock +#define SYNC_MASTER_COORDINATES_TO_SLAVE_SECS 20 // for OPTION_SYNC_MASTER_COORDINATES_TO_SLAVE - use when GPS unit is connected to slave unit and you want to synchronize the master unit coordinates to the slave unit GPS + + +#define ETHERNET_MAC_ADDRESS 0xDE,0xAD,0xBE,0xEF,0xFE,0xEE //<-DON'T FORGET TO USE DIFFERENT MAC ADDRESSES FOR MASTER AND SLAVE!!! +#define ETHERNET_IP_ADDRESS 192,168,1,172 //<-DON'T FORGET TO USE DIFFERENT IP ADDRESSES FOR MASTER AND SLAVE!!! +#define ETHERNET_IP_GATEWAY 192,168,1,1 +#define ETHERNET_IP_SUBNET_MASK 255,255,255,0 +#define ETHERNET_TCP_PORT_0 23 +#define ETHERNET_TCP_PORT_1 24 +#define ETHERNET_MESSAGE_TIMEOUT_MS 5000 +#define ETHERNET_PREAMBLE "K3NG" // used only with Ethernet master/slave link + +#define ETHERNET_SLAVE_IP_ADDRESS 192,168,1,173 +#define ETHERNET_SLAVE_TCP_PORT 23 +#define ETHERNET_SLAVE_RECONNECT_TIME_MS 250 + +#define POWER_SWITCH_IDLE_TIMEOUT 15 // use with FEATURE_POWER_SWITCH; units are minutes + +#ifdef HARDWARE_EA4TX_ARS_USB +#define BUTTON_ACTIVE_STATE HIGH +#define BUTTON_INACTIVE_STATE LOW +#else +#define BUTTON_ACTIVE_STATE LOW +#define BUTTON_INACTIVE_STATE HIGH +#endif + +/* + * + * Azimuth and Elevation calibraton tables - use with FEATURE_AZIMUTH_CORRECTION and/or FEATURE_ELEVATION_CORRECTION + * + * You must have the same number of entries in the _FROM_ and _TO_ arrays! + * + */ + +#define AZIMUTH_CALIBRATION_FROM_ARRAY {180,630} /* these are in "raw" degrees, i.e. when going east past 360 degrees, add 360 degrees*/ +#define AZIMUTH_CALIBRATION_TO_ARRAY {180,630} + +// example: reverse rotation sensing +// #define AZIMUTH_CALIBRATION_FROM_ARRAY {0,359} +// #define AZIMUTH_CALIBRATION_TO_ARRAY {359,0} + + +#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 + +#define EL_POSITION_PULSE_DEBOUNCE 500 // in ms + + +/* Pololu LSM303 Calibration tables + * + * + * For use with FEATURE_AZ_POSITION_POLOLU_LSM303 and/or FEATURE_EL_POSITION_POLOLU_LSM303 + * + + + Calibration values; the default values of +/-32767 for each axis + lead to an assumed magnetometer bias of 0. Use the Calibrate example + program to determine appropriate values for your particular unit. + + min: { +59, +19, -731} max: { +909, +491, +14} + min: {32767, 32767, 32767} max: {-32768, -32768, -32768} + + */ + +#define POLOLU_LSM_303_MIN_ARRAY {+59, +19, -731} +#define POLOLU_LSM_303_MAX_ARRAY {+909, +491, +14} + +#define AUTOCORRECT_TIME_MS_AZ 1000 +#define AUTOCORRECT_TIME_MS_EL 1000 diff --git a/k3ng_rotator_controller/rotator_settings_ea4tx_ars_usb.h b/k3ng_rotator_controller/rotator_settings_ea4tx_ars_usb.h index fd36500..d00551b 100755 --- a/k3ng_rotator_controller/rotator_settings_ea4tx_ars_usb.h +++ b/k3ng_rotator_controller/rotator_settings_ea4tx_ars_usb.h @@ -314,5 +314,4 @@ You can tweak these, but read the online documentation! #define AUTOCORRECT_TIME_MS_AZ 1000 #define AUTOCORRECT_TIME_MS_EL 1000 -#define PIN_LED_ACTIVE_STATE HIGH -#define PIN_LED_INACTIVE_STATE LOW + diff --git a/k3ng_rotator_controller/rotator_settings_m0upu.h b/k3ng_rotator_controller/rotator_settings_m0upu.h index fd36500..d00551b 100755 --- a/k3ng_rotator_controller/rotator_settings_m0upu.h +++ b/k3ng_rotator_controller/rotator_settings_m0upu.h @@ -314,5 +314,4 @@ You can tweak these, but read the online documentation! #define AUTOCORRECT_TIME_MS_AZ 1000 #define AUTOCORRECT_TIME_MS_EL 1000 -#define PIN_LED_ACTIVE_STATE HIGH -#define PIN_LED_INACTIVE_STATE LOW + diff --git a/k3ng_rotator_controller/rotator_settings_test.h b/k3ng_rotator_controller/rotator_settings_test.h index 29dd377..2d5baab 100755 --- a/k3ng_rotator_controller/rotator_settings_test.h +++ b/k3ng_rotator_controller/rotator_settings_test.h @@ -334,9 +334,6 @@ You can tweak these, but read the online documentation! #define AUTOCORRECT_TIME_MS_AZ 1000 #define AUTOCORRECT_TIME_MS_EL 1000 -#define PIN_LED_ACTIVE_STATE HIGH -#define PIN_LED_INACTIVE_STATE LOW - // ######## ######## ###### ######## diff --git a/k3ng_rotator_controller/rotator_settings_wb6kcn.h b/k3ng_rotator_controller/rotator_settings_wb6kcn.h index 3ecb34b..8d2ea74 100755 --- a/k3ng_rotator_controller/rotator_settings_wb6kcn.h +++ b/k3ng_rotator_controller/rotator_settings_wb6kcn.h @@ -316,6 +316,4 @@ You can tweak these, but read the online documentation! #define AUTOCORRECT_TIME_MS_AZ 1000 #define AUTOCORRECT_TIME_MS_EL 1000 -#define PIN_LED_ACTIVE_STATE HIGH -#define PIN_LED_INACTIVE_STATE LOW \ No newline at end of file