Skip to content

Commit 1aff4c6

Browse files
V1.8.10 - Updates
- Permanent display of tracking state in top-right corner of display. - Shortened menu display - Full GPS module (GT-U7) support for LST and location - Separated HA menu into two files (one for GPS support, one for non-GPS) - Added display of current location to INFO menu
1 parent c93998c commit 1aff4c6

18 files changed

+363
-104
lines changed

Software/Arduino code/OpenAstroTracker/Configuration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
=======================================================================================================================================
1919
*/
2020

21-
String version = "V1.8.06";
21+
String version = "V1.8.10";
2222

2323
///////////////////////////////////////////////////////////////////////////
2424
// Also use Configuration_adv for further adjustments!

Software/Arduino code/OpenAstroTracker/Configuration_adv.hpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135

136136
//
137137
// Set this to 1 if you are using a NEO6m GPS module for HA/LST and location automatic determination.
138-
//
138+
// GPS uses Serial1 by default, which is pins 18/19 on Mega. Change in configuration_adv.hpp
139139
#define USE_GPS 0
140140
// If supported, download the library https://github.com/mikalhart/TinyGPSPlus/releases and extract it to C:\Users\*you*\Documents\Arduino\libraries
141141

@@ -273,15 +273,6 @@
273273

274274

275275

276-
277-
278-
279-
280-
281-
282-
283-
284-
285276
////////////////////////////
286277
// ERRORS
287278

Software/Arduino code/OpenAstroTracker/EPROMStore.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void EPROMStore::initialize()
1616
}
1717
}
1818

19-
// Get the instance of the EEPROM storage
19+
// Get the instance of the EEPROM storage
2020
EPROMStore *EPROMStore::Storage()
2121
{
2222
return _eepromStore;
@@ -40,7 +40,7 @@ void EPROMStore::update(int location, uint8_t value)
4040
EEPROM.commit();
4141
}
4242

43-
// Read the value at the given location
43+
// Read the value at the given location
4444
uint8_t EPROMStore::read(int location)
4545
{
4646
uint8_t value;
@@ -60,16 +60,33 @@ EPROMStore::EPROMStore()
6060
// Update the given location with the given value
6161
void EPROMStore::update(int location, uint8_t value)
6262
{
63-
LOGV3(DEBUG_VERBOSE, "EEPROM[UNO]: Writing %x to %d", value, location);
63+
LOGV3(DEBUG_VERBOSE, "EEPROM[UNO]: Writing8 %x to %d", value, location);
6464
EEPROM.write(location, value);
6565
}
6666

67-
// Read the value at the given location
67+
// Read the value at the given location
6868
uint8_t EPROMStore::read(int location)
6969
{
7070
uint8_t value = EEPROM.read(location);
71-
LOGV3(DEBUG_VERBOSE, "EEPROM[UNO]: Read %x from %d", value, location);
71+
LOGV3(DEBUG_VERBOSE, "EEPROM[UNO]: Read8 %x from %d", value, location);
7272
return value;
7373
}
7474

7575
#endif
76+
77+
void EPROMStore::updateInt16(int loByteAddr, int hiByteAddr, int16_t value)
78+
{
79+
LOGV4(DEBUG_VERBOSE, "EEPROM: Writing16 %d to %d, %d", value, loByteAddr, hiByteAddr);
80+
update(loByteAddr, value & 0x00FF);
81+
update(hiByteAddr, (value >> 8) & 0x00FF);
82+
}
83+
84+
int16_t EPROMStore::readInt16(int loByteAddr, int hiByteAddr)
85+
{
86+
uint8_t valLo=EPROMStore::Storage()->read(loByteAddr);
87+
uint8_t valHi=EPROMStore::Storage()->read(hiByteAddr);
88+
uint16_t uValue = (uint16_t)valLo + (uint16_t)valHi * 256;
89+
int16_t value = static_cast<int16_t>(uValue);
90+
LOGV4(DEBUG_VERBOSE, "EEPROM: Read16 %d from %d, %d", value, loByteAddr, hiByteAddr);
91+
return value;
92+
}

Software/Arduino code/OpenAstroTracker/EPROMStore.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class EPROMStore {
1313

1414
void update(int location, uint8_t value);
1515
uint8_t read(int location);
16+
17+
void updateInt16(int loByteAddr, int hiByteAddr, int16_t value);
18+
int16_t readInt16(int loByteAddr, int hiByteAddr);
19+
1620
static EPROMStore* Storage();
1721
};
1822

Software/Arduino code/OpenAstroTracker/LcdMenu.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// You add a string and an id item and this class handles the display and navigation
99
// Create a new menu, using the given number of LCD display columns and rows
1010
LcdMenu::LcdMenu(byte cols, byte rows, int maxItems) : _lcd(8, 9, 4, 5, 6, 7) {
11-
//_lcd = new LiquidCrystal(8, 9, 4, 5, 6, 7);
1211
_lcd.begin(cols, rows);
1312
_numMenuItems = 0;
1413
_activeMenuIndex = 0;
@@ -140,9 +139,10 @@ void LcdMenu::updateDisplay() {
140139
_lcd.setCursor(0, 0);
141140
_activeRow = 0;
142141
_activeCol = 0;
142+
int usableColumns = _columns - 4; // Leave off last four to have distance to tracking indicator
143143

144144
// Determine where to place the active menu item. (empty space around longest item divided by two).
145-
int margin = (_columns - (_longestDisplay)) / 2;
145+
int margin = (usableColumns - (_longestDisplay)) / 2;
146146
int offsetIntoString = offsetToActive - margin;
147147

148148
// Pad the front if we don't have enough to offset the string to the arrow locations (happens on first item(s))
@@ -152,7 +152,7 @@ void LcdMenu::updateDisplay() {
152152
}
153153

154154
// Display the actual menu string
155-
while ((pBufMenu < bufMenu + _columns) && (offsetIntoString < (int)menuString.length())) {
155+
while ((pBufMenu < bufMenu + usableColumns) && (offsetIntoString < (int)menuString.length())) {
156156
*(pBufMenu++) = menuString[offsetIntoString++];
157157
}
158158

@@ -167,6 +167,7 @@ void LcdMenu::updateDisplay() {
167167
setCursor(0, 1);
168168
}
169169

170+
// Print the given character to the LCD, converting some special ones to our bitmaps
170171
void LcdMenu::printChar(char ch) {
171172
if (ch == '>') {
172173
_lcd.write(_rightArrow);
@@ -191,6 +192,12 @@ void LcdMenu::printChar(char ch) {
191192
}
192193
}
193194

195+
// Print a character at a specific position
196+
void LcdMenu::printAt(int col, int row, char ch) {
197+
_lcd.setCursor(col, row);
198+
printChar(ch);
199+
}
200+
194201
// Print a string to the LCD at the current cursor position, substituting the special arrows and padding with spaces to the end
195202
void LcdMenu::printMenu(String line) {
196203
if ((_lastDisplay[_activeRow] != line) || (_activeCol != 0)) {

Software/Arduino code/OpenAstroTracker/LcdMenu.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ class LcdMenu {
6969
// Print a string to the LCD at the current cursor position, substituting the special arrows and padding with spaces to the end
7070
void printMenu(String line);
7171

72+
// Print a character at a specific position
73+
void printAt(int col, int row, char ch);
74+
7275
private:
76+
// Print a single character at the current cursor location and advance cursor by one. Substitutes special chars.
7377
void printChar(char ch);
7478

7579
private:

0 commit comments

Comments
 (0)