course calculation corrected

pull/2/head
Christian OE3CJB Bauer 2020-02-02 13:45:19 +01:00
parent 715e332875
commit b48fc3fea0
2 changed files with 33 additions and 4 deletions

View File

@ -1,5 +1,9 @@
<h2>Installation Guide for PlatformIO</h2> <h2>Installation Guide using PlatformIO</h2>
<br> <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> 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> <img src="img/img1.jpg" width="480"><br>
Search and install the following libaries:<br> Search and install the following libaries:<br>
@ -15,5 +19,17 @@ Search and install the following libaries:<br>
<li>DallasTemperature</li> <li>DallasTemperature</li>
</ul> </ul>
<br> <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> 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> 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>

View File

@ -525,9 +525,22 @@ void loop() {
++point_avg_course; ++point_avg_course;
if (point_avg_course>2) { if (point_avg_course>2) {
point_avg_course=0; point_avg_course=0;
new_course = (average_course[0]+average_course[1]+average_course[2])/3; // new_course = (average_course[0]+average_course[1]+average_course[2])/3;
if (abs(new_course-old_course)>=30) { 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])));
nextTX = 0; 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; old_course = new_course;
} }