Skip to content

Commit ecb1498

Browse files
committed
minor changes to display board
1 parent 6065b8a commit ecb1498

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Display/src/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <std_msgs/Float64.h>
1010
#include <std_msgs/Int32.h>
1111
#include <std_msgs/String.h>
12+
#include <cmath>
1213

1314
// Define pin configurations
1415
#define TFT_DC 9
@@ -57,7 +58,7 @@ float batt_voltage_1_new = 0;
5758
float batt_voltage_2_new = 0;
5859
int thrusters_new[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
5960
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!";
6162
int tether_new = 0;
6263

6364
// Define global variables for display functions
@@ -160,9 +161,9 @@ void initMainScreen() {
160161

161162
// Function to update battery 1 display
162163
void batt1(float V1) {
163-
V1 = round(V1 * 10) / 10;
164+
V1 = round(V1 * 10.0) / 10.0;
164165
V1 = movingAverage1(V1);
165-
V1 = round(V1 * 10) / 10;
166+
V1 = round(V1 * 10.0) / 10.0;
166167

167168
voltages_new[0] = V1;
168169
if (voltages_old[0] != voltages_new[0]) {
@@ -201,9 +202,9 @@ void batt1(float V1) {
201202

202203
// Function to update battery 2 display
203204
void batt2(float V2) {
204-
V2 = round(V2 * 10) / 10;
205+
V2 = round(V2 * 10.0) / 10.0;
205206
V2 = movingAverage2(V2);
206-
V2 = round(V2 * 10) / 10;
207+
V2 = round(V2 * 10.0) / 10.0;
207208

208209
voltages_new[1] = V2;
209210
if (voltages_old[1] != voltages_new[1]) {

0 commit comments

Comments
 (0)