fix bugs
This commit is contained in:
parent
370206729a
commit
83989d8e40
10
src/main.cpp
10
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<int> 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;
|
||||
|
|
Loading…
Reference in New Issue