diff --git a/k3ng_rotator_controller.ino b/k3ng_rotator_controller.ino index a45f0e0..2723982 100644 --- a/k3ng_rotator_controller.ino +++ b/k3ng_rotator_controller.ino @@ -458,7 +458,10 @@ DEBUG_HH12 more information output 2.0.2016030101 - FEATURE_AZ_POSITION_HH12_AS5045_SSI: AZIMUTH_STARTING_POINT_DEFAULT used in heading calculation now + FEATURE_AZ_POSITION_HH12_AS5045_SSI: AZIMUTH_STARTING_POINT_DEFAULT used in heading calculation now + + 2.0.2016030201 + Fixed FEATURE_ADAFRUIT_BUTTONS to work with k3ngdisplay library and updated k3ngdisplay library to support Adafruit RGB display buttons All library files should be placed in \sketchbook\libraries\some-directory\ in order to compile in Arduino IDE 1.6.7 Anything rotator_*.* should be in the ino directory! @@ -466,7 +469,7 @@ */ -#define CODE_VERSION "2.0.2016030101" +#define CODE_VERSION "2.0.2016030201" #include #include @@ -2965,7 +2968,8 @@ void check_buttons(){ #ifdef FEATURE_ADAFRUIT_BUTTONS int buttons = 0; - buttons = lcd.readButtons(); + // buttons = lcd.readButtons(); + buttons = k3ngdisplay.readButtons(); if (buttons & BUTTON_RIGHT) { #else diff --git a/rotator_features.h b/rotator_features.h index ce08a8b..d82f566 100755 --- a/rotator_features.h +++ b/rotator_features.h @@ -65,7 +65,7 @@ // And if you are using an Adafruit, Yourduino, RFRobot, or YWRobot display, you must change the feature setting in k3ngdisplay.h!!!! // #define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) // #define FEATURE_ADAFRUIT_I2C_LCD -// #define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons +// #define FEATURE_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 diff --git a/rotator_features_m0upu.h b/rotator_features_m0upu.h index 24c36a0..c74b8b6 100755 --- a/rotator_features_m0upu.h +++ b/rotator_features_m0upu.h @@ -63,7 +63,7 @@ // And if you are using an Adafruit, Yourduino, RFRobot, or YWRobot display, you must change the feature setting in k3ngdisplay.h!!!! #define FEATURE_4_BIT_LCD_DISPLAY //Uncomment for classic 4 bit LCD display (most common) //#define FEATURE_ADAFRUIT_I2C_LCD -//#define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons +// #define FEATURE_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_ANALOG_OUTPUT_PINS diff --git a/rotator_features_test.h b/rotator_features_test.h index 8362002..98cc4ac 100755 --- a/rotator_features_test.h +++ b/rotator_features_test.h @@ -68,10 +68,10 @@ // All displays require k3ngdisplay.h and k3ngdisplay.cpp in a directory in \sketchbook\libraries\ -// And if you are using an Adafruit, Yourduino, RFRobot, or YWRobot display, you must change the feature setting in k3ngdisplay.h!!!! -#define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) +// **** And if you are using an Adafruit, Yourduino, RFRobot, or YWRobot display, you must change the feature setting in k3ngdisplay.h!!!! +// #define FEATURE_4_BIT_LCD_DISPLAY // Uncomment for classic 4 bit LCD display (most common) // #define FEATURE_ADAFRUIT_I2C_LCD -// #define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons +// #define FEATURE_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 diff --git a/rotator_features_wb6kcn.h b/rotator_features_wb6kcn.h index bcf3f9d..e3f7478 100755 --- a/rotator_features_wb6kcn.h +++ b/rotator_features_wb6kcn.h @@ -64,7 +64,7 @@ // And if you are using an Adafruit, Yourduino, RFRobot, or YWRobot display, you must change the feature setting in k3ngdisplay.h!!!! //#define FEATURE_4_BIT_LCD_DISPLAY //Uncomment for classic 4 bit LCD display (most common) //#define FEATURE_ADAFRUIT_I2C_LCD -//#define FEATURE_ADAFRUIT_BUTTONS // Uncomment this to use Adafruit I2C LCD buttons for manual AZ/EL instead of normal buttons +// #define FEATURE_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 diff --git a/rotator_k3ngdisplay.cpp b/rotator_k3ngdisplay.cpp index b87a4d7..87f2be7 100644 --- a/rotator_k3ngdisplay.cpp +++ b/rotator_k3ngdisplay.cpp @@ -1,7 +1,7 @@ #ifndef K3NG_DISPLAY_H #define K3NG_DISPLAY_H -// K3NG_DISPLAY_LIBRARY_VERSION "1.0.2016012301" +// K3NG_DISPLAY_LIBRARY_VERSION "1.0.2016030201" #if defined(ARDUINO) && ARDUINO >= 100 @@ -102,12 +102,12 @@ void K3NGdisplay::initialize(){ // k3ngdisplay.h and k3ngdisplay.cpp from your ino directory #ifdef FEATURE_YOURDUINO_I2C_LCD - lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); - lcd.setBacklight(I2C_LCD_COLOR); + lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); + lcd.setBacklight(I2C_LCD_COLOR); #endif // FEATURE_YOURDUINO_I2C_LCD #ifdef FEATURE_ADAFRUIT_I2C_LCD - lcd.setBacklight(I2C_LCD_COLOR); + lcd.setBacklight(I2C_LCD_COLOR); #endif // FEATURE_ADAFRUIT_I2C_LCD clear(); @@ -724,6 +724,14 @@ void K3NGdisplay::revert_back_screen(){ //----------------------------------------------------------------------------------------------------- +#if defined(FEATURE_ADAFRUIT_BUTTONS) +uint8_t K3NGdisplay::readButtons(){ + + return lcd.readButtons(); + +} +#endif //FEATURE_ADAFRUIT_BUTTONS + #endif //K3NG_DISPLAY_H diff --git a/rotator_k3ngdisplay.h b/rotator_k3ngdisplay.h index 433e3de..c2324e6 100644 --- a/rotator_k3ngdisplay.h +++ b/rotator_k3ngdisplay.h @@ -17,10 +17,13 @@ */ #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_ADAFRUIT_I2C_LCD +// #define FEATURE_YOURDUINO_I2C_LCD +// #define FEATURE_RFROBOT_I2C_DISPLAY +// #define FEATURE_YWROBOT_I2C_DISPLAY + +// #define FEATURE_ADAFRUIT_BUTTONS + #include "rotator_hardware.h" @@ -57,8 +60,11 @@ #include "rotator_pins.h" #endif +#if defined(FEATURE_ADAFRUIT_I2C_LCD) + #include "rotator.h" +#endif -#define K3NG_DISPLAY_LIBRARY_VERSION "1.0.2016012301" +#define K3NG_DISPLAY_LIBRARY_VERSION "1.0.2016030201" #define MAX_SCREEN_BUFFER_COLUMNS 20 #define MAX_SCREEN_BUFFER_ROWS 4 @@ -67,6 +73,8 @@ #define TEXT_BLINK_MS 500 #define WORK_STRING_SIZE 32 +#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino units may want this as LED_ON + class K3NGdisplay { public: @@ -117,6 +125,10 @@ public: int length(char * print_string); void clear_row(uint8_t row_number); // clear one entire row + #if defined(FEATURE_ADAFRUIT_BUTTONS) + uint8_t readButtons(); + #endif + private: void save_current_screen_to_revert_screen_buffer(); // used by the timed message functionality to push the current screen to a buffer for saving diff --git a/rotator_settings.h b/rotator_settings.h index abd812f..868ad14 100755 --- a/rotator_settings.h +++ b/rotator_settings.h @@ -106,7 +106,6 @@ You can tweak these, but read the online documentation! #define LCD_COLUMNS 20 //16 #define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds -#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT diff --git a/rotator_settings_ea4tx_ars_usb.h b/rotator_settings_ea4tx_ars_usb.h index dbd939d..06c0aa3 100755 --- a/rotator_settings_ea4tx_ars_usb.h +++ b/rotator_settings_ea4tx_ars_usb.h @@ -106,7 +106,6 @@ You can tweak these, but read the online documentation! #define LCD_COLUMNS 20 //16 #define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds -#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT diff --git a/rotator_settings_m0upu.h b/rotator_settings_m0upu.h index 4524c19..31f2c2d 100755 --- a/rotator_settings_m0upu.h +++ b/rotator_settings_m0upu.h @@ -106,7 +106,6 @@ You can tweak these, but read the online documentation! #define LCD_COLUMNS 20 //16 #define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds -#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT diff --git a/rotator_settings_test.h b/rotator_settings_test.h index b47d6f7..b67b539 100755 --- a/rotator_settings_test.h +++ b/rotator_settings_test.h @@ -117,7 +117,6 @@ You can tweak these, but read the online documentation! #define LCD_COLUMNS 20 //16 #define LCD_ROWS 4 //2 // this is automatically set below for HARDWARE_EA4TX_ARS_USB and HARDWARE_M0UPU #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds -#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT diff --git a/rotator_settings_wb6kcn.h b/rotator_settings_wb6kcn.h index 2cee53b..c4b1742 100755 --- a/rotator_settings_wb6kcn.h +++ b/rotator_settings_wb6kcn.h @@ -107,7 +107,6 @@ You can tweak these, but read the online documentation! #define LCD_COLUMNS 20 //16 #define LCD_ROWS 4 //2 #define LCD_UPDATE_TIME 1000 // LCD update time in milliseconds -#define I2C_LCD_COLOR GREEN // default color of I2C LCD display, including Adafruit and Yourduino; some Yourduino may want this as LED_ON #define LCD_HHMM_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_HHMMSS_CLOCK_POSITION LEFT //LEFT or RIGHT #define LCD_ALT_HHMM_CLOCK_AND_MAIDENHEAD_POSITION LEFT