Go Down

Topic: ST7735 (Read 2515 times) previous topic - next topic

Docedison

Is the UTFT library any better than the Library provided by AdaFruit... The AdaFruit library works fairly well But the display is capable of 262K colors... (18 Bit) and the Adafruit display and Lib can do white, black, blue, red, yellow, green and Magenta. I should think that there are more colors available... ?

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

beige

I guess your using this library? https://github.com/adafruit/Adafruit-ST7735-Library

If so, I've just had a look and where the function accept colour it's looking for a 16 bit value, such as
Code: [Select]
fillScreen(uint16_t color)

The colours such as RED are defined in the header file
Code: [Select]
#define ST7735_RED     0xF800

So you should be able to pass and colour you like.


It even includes a function to convert 8 bits per colour into the single 16 bit value
Code: [Select]
// Pass 8-bit (each) R,G,B, get back 16-bit packed color
uint16_t Adafruit_ST7735::Color565(uint8_t r, uint8_t g, uint8_t b) {
  return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}

Docedison

Well I am a complete NOOB to C and C++ I study very hard but still I have forgotten more electronics today than I have learned C... Being an older dude... is there enough additional information there so I can figure out how to pass the values to that method? (Right word?). I can make Almost Anything work if it is Electronic butI have a long way to go before I can become proficient at writing C and C++. I could read and more or less understand the method although the shift operators seem rather unclear. I need to figure out how to pass it values... I also need to go get the Lib's you mentioned as I am using the Adafruit ones. All was a great education. I managed to combine a GPS sketch and the ST7735 display together without too much issue. As a matter of fact the real challenge I had was converting UTC to PDT time... because I tried the long way of pencil and paper conversion to create the conversion, finally I made an array and used the hours time as a counter for an array of correct values and it works. I just want to be able to use the ST7735 display properly as a text display. So... Thank You Sir I will takle your advice and go get the other lib and go from there.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

beige

You'll need the Adafruit GFX library to go with the one I linked to above as well,

Then you can set colours by doing something like this
Code: [Select]
tft.fillScreen(tft.Color565(127, 127, 127));

Docedison

Thank You Sir Most Whole Heartedly... Every time I ask a question here I learn the answer to my question and open up a whole other bag full of other questions. {This_is_the_way.learning::is_done}...
I have been looking, not directly but always for related things and you just filled a big hole in my quest. I found School impossible and so had to learn the hard way... under the Gun. Not impossible
Just a 'little' harder.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Go Up