|
9 | 9 | #include <std_msgs/Float64.h>
|
10 | 10 | #include <std_msgs/Int32.h>
|
11 | 11 | #include <std_msgs/String.h>
|
| 12 | +#include <cmath> |
12 | 13 |
|
13 | 14 | // Define pin configurations
|
14 | 15 | #define TFT_DC 9
|
@@ -57,7 +58,7 @@ float batt_voltage_1_new = 0;
|
57 | 58 | float batt_voltage_2_new = 0;
|
58 | 59 | int thrusters_new[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
59 | 60 | int devices_new[] = { 0, 0, 0, 0, 0, 0, 0 };
|
60 |
| -String status_new = "I am Douglas!"; |
| 61 | +String status_new = "JP is my father!"; |
61 | 62 | int tether_new = 0;
|
62 | 63 |
|
63 | 64 | // Define global variables for display functions
|
@@ -160,9 +161,9 @@ void initMainScreen() {
|
160 | 161 |
|
161 | 162 | // Function to update battery 1 display
|
162 | 163 | void batt1(float V1) {
|
163 |
| - V1 = round(V1 * 10) / 10; |
| 164 | + V1 = round(V1 * 10.0) / 10.0; |
164 | 165 | V1 = movingAverage1(V1);
|
165 |
| - V1 = round(V1 * 10) / 10; |
| 166 | + V1 = round(V1 * 10.0) / 10.0; |
166 | 167 |
|
167 | 168 | voltages_new[0] = V1;
|
168 | 169 | if (voltages_old[0] != voltages_new[0]) {
|
@@ -201,9 +202,9 @@ void batt1(float V1) {
|
201 | 202 |
|
202 | 203 | // Function to update battery 2 display
|
203 | 204 | void batt2(float V2) {
|
204 |
| - V2 = round(V2 * 10) / 10; |
| 205 | + V2 = round(V2 * 10.0) / 10.0; |
205 | 206 | V2 = movingAverage2(V2);
|
206 |
| - V2 = round(V2 * 10) / 10; |
| 207 | + V2 = round(V2 * 10.0) / 10.0; |
207 | 208 |
|
208 | 209 | voltages_new[1] = V2;
|
209 | 210 | if (voltages_old[1] != voltages_new[1]) {
|
|
0 commit comments