Closed bsbrum closed 1 year ago
Hi I have another version with 4 digits modules: https://github.com/javagoza/Remote-IAQ-Monitor
Hi I have another version with 4 digits modules: https://github.com/javagoza/Remote-IAQ-Monitor
Enrique - thank you for this. It did get me past the 4 digit issue. I am still bending my brain around the lcd segment off state issue - this is sent with zero as the value. It may be the result of an early porting edit, I am still on the hunt to solve that.
Thanks, again.
Are you setting the offColor as a different color than the onColor?
TFTSevenSegmentDecimalDisplay::TFTSevenSegmentDecimalDisplay(Adafruit_ST7735* tft, int16_t x = 0, int16_t y = 0, int16_t w = 16, int16_t h = 32, uint16_t onColor = 255, uint16_t offColor = 0, int16_t ledWidth = 3 )
Yes, on and off are different.
ILI9486UTFT myGLCD(ILI9486,LCDPIN1,LCDPIN2,LCDPIN3,LCDPIN4); TFTSevenSegmentDecimalDisplay tachDisplay(&myGLCD, 30, 30, 60, 110, GREEN, BLACK, 10); TFTSevenSegmentDecimalDisplay inputDisplay(&myGLCD, 160, 250, 20, 35, WHITE, BLACK, 5);
It seems to be the way that the UTFT library sets color. I've been trying a lot of different ways to get around this, but nothing yet has worked - even tried this, using the UTFT setColor method directly in the SevenSegmentDecimalDisplay.cpp without any luck:
if (thousands > 0) {
m_tft->setColor(0x07E0); // added << green
digits[THOUSANDS]->on();
digits[THOUSANDS]->display(thousands % 10);
} else {
m_tft->setColor(0x0000); // added << black
digits[THOUSANDS]->off();
digits[THOUSANDS]->display(0);
}
How did you port the TFTSevenSegmentModule.cpp file? To delete the segments that are off, they are painted with the off color.
draw_F_LeftUpperLed((leds & 32) && m_on ? m_onColor : m_offColor);
void TFTSevenSegmentModule::draw_F_LeftUpperLed(uint16_t color) {
m_tft->startWrite();
for (int i = 0; i < m_ledWidth; i++) {
m_tft->writeFastVLine(m_x + i, m_y + i, m_h / 2 - 2 * i, color);
}
m_tft->endWrite();
}
Do you have an option similar to writeFastVLine in the library you use?
Enrique- Yes, the UTFT library has "drawVLine" but there is no color option for that function. Which is why I was trying to set it up-stream a bit. I'll see what I can do with that library to add color setting to see if that resolves it.
Thank you for your help.
void TFTSevenSegmentModule::draw_F_LeftUpperLed(uint16_t color) {
//m_tft->startWrite();
m_tft->wr
for (int i = 0; i < m_ledWidth; i++) {
m_tft->drawVLine(m_x + i, m_y + i, m_h / 2 - 2 * i);
}
//m_tft->endWrite();
}
Then set the color before drawVLine and drawHLine in all the functions that uses those functions in that file
m_tft->setColor(color);
m_tft->drawVLine(m_x + i, m_y + i, m_h / 2 - 2 * i);
Can you put a link to the library you use?
m_tft->setColor(color);
Enrique- This suggestion has got me going, thank you. I was headed in this direction but you bumped me there sooner. Thanks.
I'm glad you fixed it. Enjoy it! Is the repaint fast enough? In my version, I used a method that allows sending several commands in a row to the display and it did it quite quickly? I see that that library doesn't have those startWrite() and endWrite() methods
I am still debugging, so it's too soon to say. I'll let you know. once I get it fully operational. I really appreciate all your effort and assistance. Cheers!
Enrique - you are the man! This is working fantastically. I cannot thank you enough.
Thanks for the feedback. Cheers!
Enrique- Thank you for your work, I am building a motor speed controller for a milling machine, and your library seems to be a solution for the problem I've hit which is a simulated 7-segment display that refreshes quickly. My attempts to use a large 7-segment font are unacceptable. The challenge that I have is that I've adapted your library to my solution, which is based on an Arduino Mega and an ILI9486 3.5" LCD. The LCD driver is through the UTFT package since the Adafruit 2.5" LCD library does not work with this screen. I have 2 problems that I was hoping you might be able to give me some clues to resolve:
I've scoured through the code, made some modifications and adaptations to try to increase the segment count for the "hundreds" display and figure out the "off" condition, but I am only seeing the three digits as eights.
Any tips would be greatly appreciated. Thanks, again.