LCD Work step1

This commit is contained in:
phdlee
2018-04-12 22:08:43 +09:00
parent 34be2d0845
commit d721816039
11 changed files with 1747 additions and 266 deletions

View File

@@ -27,9 +27,27 @@
//========================================================================
//Begin of LCD Hardware define
//The I2C LCD I ordered did not arrive yet.
//I referenced the I2C LCD control in the thread at the link below.
////https://groups.io/g/BITX20/topic/variation_on_ian_s_kd8cec/16657839?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,16657839
//In particular, I referenced the sample code of John (VK2ETA) and K9HZ. Jack, W8TEE, Nick
//========================================================================
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,10,11,12,13);
//#include <LiquidCrystal.h>
//LiquidCrystal lcd(8,9,10,11,12,13);
//K9HZ's Code
//#include <LiquidCrystal_I2C.h>
//LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); //
//Jack(W8TEE) Code
//LiquidCrystal_I2C lcd(0x3F); // I2C address
//John(VK2ETA) Code
#include <LiquidCrystal_I2C.h>
#define I2C_DISPLAY_ADDRESS 0x27
LiquidCrystal_I2C lcd(I2C_DISPLAY_ADDRESS,16,2); // set the LCD as a 16 chars and 2 line display
//LiquidCrystal_I2C lcd(0x27,16,2)
//========================================================================
@@ -337,6 +355,16 @@ void updateLine2Buffer(char displayType)
//display frequency
tmpFreq = ritTxFrequency;
//Fixed by Mitani Massaru (JE4SMQ)
if (isShiftDisplayCWFreq == 1)
{
if (cwMode == 1) //CWL
tmpFreq = tmpFreq - sideTone + shiftDisplayAdjustVal;
else if (cwMode == 2) //CWU
tmpFreq = tmpFreq + sideTone + shiftDisplayAdjustVal;
}
for (int i = 15; i >= 6; i--) {
if (tmpFreq > 0) {
if (i == 12 || i == 8) line2Buffer[i] = '.';
@@ -537,16 +565,27 @@ void idle_process()
}
}
void Display_AutoKeyTextIndex(char textIndex)
void Display_AutoKeyTextIndex(byte textIndex)
{
byte diplayAutoCWLine = 0;
if ((displayOption1 & 0x01) == 0x01)
diplayAutoCWLine = 1;
lcd.setCursor(0, diplayAutoCWLine);
lcd.write(byteToChar(selectedCWTextIndex));
lcd.write(byteToChar(textIndex));
lcd.write(':');
}
void DisplayCallsign(byte callSignLength)
{
printLineFromEEPRom(0, 0, 0, userCallsignLength -1, 0); //eeprom to lcd use offset (USER_CALLSIGN_DAT)
//delay(500);
}
void DisplayVersionInfo(const __FlashStringHelper * fwVersionInfo)
{
printLineF(1, fwVersionInfo);
}
#endif