Skip to content

Commit

Permalink
new line for SSD1306
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Dec 15, 2024
1 parent c8f4161 commit e718a05
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 103 deletions.
16 changes: 9 additions & 7 deletions lib/APRSPacketLib/APRSPacketLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,20 @@ namespace APRSPacketLib {
}
int encodedBytePosition = temp0.indexOf(gpsChar) + 14;
aprsPacket.message = temp0.substring(temp0.indexOf(gpsChar) + 2);
if (String(temp0[encodedBytePosition]) == "G" || String(temp0[encodedBytePosition]) == "Q" || String(temp0[encodedBytePosition]) == "[" || String(temp0[encodedBytePosition]) == "H") {
aprsPacket.latitude = decodeEncodedLatitude(temp0.substring(temp0.indexOf(gpsChar) + 3, temp0.indexOf(gpsChar) + 7));
aprsPacket.longitude = decodeEncodedLongitude(temp0.substring(temp0.indexOf(gpsChar) + 7, temp0.indexOf(gpsChar) + 11));
aprsPacket.symbol = temp0.substring(temp0.indexOf(gpsChar) + 11, temp0.indexOf(gpsChar) + 12);
aprsPacket.overlay = temp0.substring(temp0.indexOf(gpsChar) + 2, temp0.indexOf(gpsChar) + 3);
char currentChar = temp0[encodedBytePosition];
if (currentChar == 'G' || currentChar == 'Q' || currentChar == '[' || currentChar == 'H' || currentChar == 'X') {
aprsPacket.latitude = decodeEncodedLatitude(temp0.substring(temp0.indexOf(gpsChar) + 3, temp0.indexOf(gpsChar) + 7));
aprsPacket.longitude = decodeEncodedLongitude(temp0.substring(temp0.indexOf(gpsChar) + 7, temp0.indexOf(gpsChar) + 11));
aprsPacket.symbol = temp0.substring(temp0.indexOf(gpsChar) + 11, temp0.indexOf(gpsChar) + 12);
aprsPacket.overlay = temp0.substring(temp0.indexOf(gpsChar) + 2, temp0.indexOf(gpsChar) + 3);

if (temp0.substring(temp0.indexOf(gpsChar) + 12, temp0.indexOf(gpsChar) + 13) == " ") {
aprsPacket.course = 0;
aprsPacket.speed = 0;
aprsPacket.altitude = 0;
} else {
if (String(temp0[encodedBytePosition]) == "Q") { // altitude csT
aprsPacket.altitude = decodeEncodedAltitude(temp0.substring(temp0.indexOf(gpsChar)+12, temp0.indexOf(gpsChar)+14));
if (currentChar == 'Q') { // altitude csT
aprsPacket.altitude = decodeEncodedAltitude(temp0.substring(temp0.indexOf(gpsChar) + 12, temp0.indexOf(gpsChar) + 14));
aprsPacket.course = 0;
aprsPacket.speed = 0;
} else { // normal csT
Expand Down
2 changes: 1 addition & 1 deletion src/LoRa_APRS_Tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TinyGPSPlus gps;
BluetoothSerial SerialBT;
#endif

String versionDate = "2024.12.10";
String versionDate = "2024.12.15";

uint8_t myBeaconsIndex = 0;
int myBeaconsSize = Config.beacons.size();
Expand Down
4 changes: 3 additions & 1 deletion src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,14 @@ void displayShow(const String& header, const String& line1, const String& line2,
#else
display.setTextColor(SH110X_WHITE);
#endif
display.drawLine(0, 16, 128, 16, WHITE);
display.drawLine(0, 17, 128, 17, WHITE);
display.setTextSize(2);
display.setCursor(0, 0);
display.println(header);
display.setTextSize(1);
for (int i = 0; i < 5; i++) {
display.setCursor(0, 16 + (10 * i));
display.setCursor(0, 20 + (9 * i));
display.println(*lines[i]);
}
#ifdef ssd1306
Expand Down
Loading

0 comments on commit e718a05

Please sign in to comment.