Browse Source

course calculation corrected

pull/2/head
Christian OE3CJB Bauer 2 years ago
parent
commit
b48fc3fea0
  1. 18
      INSTALL.md
  2. 19
      src/TTGO_T-Beam_LoRa_APRS.ino

18
INSTALL.md

@ -1,5 +1,9 @@
<h2>Installation Guide for PlatformIO</h2>
<h2>Installation Guide using PlatformIO</h2>
<br>
1. Clone all files of the respository to your local working directory<br>
2. Install the missing libraries<br>
There are two possibilities - either using the Library Manager of PlatformIO or the command line tool:<br>
<h3>1. Built-In Liabrary Manager</h3>
Press the PlatformIO HOME Button to enter the Home Screen and there the Libraries Button to add missing libraries:<br>
<img src="img/img1.jpg" width="480"><br>
Search and install the following libaries:<br>
@ -15,5 +19,17 @@ Search and install the following libaries:<br>
<li>DallasTemperature</li>
</ul>
<br>
<h3>2. Command Line Tool</h3>
use the following commands<br>
platformio lib install "RadioHead"<br>
platformio lib install "TinyGPSPlus"<br>
platformio lib install "DHT sensor library for ESPx"<br>
platformio lib install "Adafruit SSD1306"<br>
platformio lib install "Adafruit GFX Library"<br>
platformio lib install "AXP202X_Library"<br>
platformio lib install "Adafruit Unified Sensor"<br>
platformio lib install "OneWire"<br>
platformio lib install "DallasTemperature"<br>
<br>
Check that the platformio.ini is available as it holds the board type for PlatformIO.<br>
After pressing the check mark the code will be compiled, after pressing the arrow it will be compiled and uploaded to a connected TTGO.<br>

19
src/TTGO_T-Beam_LoRa_APRS.ino

@ -525,9 +525,22 @@ void loop() {
++point_avg_course;
if (point_avg_course>2) {
point_avg_course=0;
new_course = (average_course[0]+average_course[1]+average_course[2])/3;
if (abs(new_course-old_course)>=30) {
nextTX = 0;
// new_course = (average_course[0]+average_course[1]+average_course[2])/3;
new_course = atan ((sin(average_course[0])+sin(average_course[1])+sin(average_course[2]))/(cos(average_course[0])+cos(average_course[1])+cos(average_course[2])));
if ((old_course < 30) && (new_course > 330)) {
if (abs(new_course-old_course-360)>=30) {
nextTX = 0;
}
} else {
if ((old_course > 330) && (new_course < 30)) {
if (abs(new_course-old_course+360)>=30) {
nextTX = 0;
}
} else {
if (abs(new_course-old_course)>=30) {
nextTX = 0;
}
}
}
old_course = new_course;
}

Loading…
Cancel
Save