From 83989d8e401419404907a969bb837ab23feac2c5 Mon Sep 17 00:00:00 2001 From: ZK Date: Tue, 21 May 2024 10:06:26 +0800 Subject: [PATCH] fix bugs --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ff5ced0..3d9cf6b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -352,7 +352,7 @@ void Graph_DrawCurve(uint16_t *data, uint16_t color) #define LINE_COUNT 1 uint32_t number = 0; static std::vector points[LINE_COUNT]; -static int colors[] = {0xfcbad3U, 0xaa96daU, TFT_BLUE, TFT_CYAN, TFT_MAGENTA, TFT_YELLOW}; +static int colors[] = {TFT_PINK, 0xaa96daU, TFT_BLUE, TFT_CYAN, TFT_MAGENTA, TFT_YELLOW}; static int xoffset, yoffset, point_count; int getBaseColor(int x, int y) @@ -369,7 +369,7 @@ void setup(void) // lcd.fillScreen(0xFFFFFFU); lcd.setBrightness(128); - Serial.begin(115200); + // Serial.begin(115200); Wire.begin(1, 0, 100000); // Default INA226 address is 0x40 @@ -445,10 +445,10 @@ void loop(void) if (prev_sec != sec) { lcd.setFont(&fonts::Font2); - lcd.setTextColor(0x999999U, 0x000000U); + lcd.setTextColor(TFT_LIGHTGRAY, 0x000000U); prev_sec = sec; lcd.setCursor(10, 10); - lcd.printf("FPS:%03d", fps); + lcd.printf("FPS : %03d", fps); // lcd.drawNumber(fps, 320, 0); fps = 0; } @@ -457,7 +457,7 @@ void loop(void) for (int i = 0; i < LINE_COUNT; i++) { - points[i][count % point_count] = -uint16_t((ina.readShuntCurrent() - 0.0026f) * 50) + 65; + points[i][count % point_count] = uint16_t(abs(ina.readShuntCurrent() - 0.0026f) * 50) + 65; // points[1][count % point_count] = -uint16_t(ina.readBusVoltage() * 5) + 65; } ++count;