Wish ST7735R TFT LCD driver needed

Cableguy

Expert
Licensed User
Longtime User
Funny, just tested it 2 seconds ago, actual just unplugged my nano board!
Test with Arduino Uno R3 clone - OK
test with Arduino Nano clone - OK
tested using the "graphictest" example file
 

Cableguy

Expert
Licensed User
Longtime User
Cool, so I can start preparing my schematics....
BTW, I will use it for a Soldering Station along with an Arduino Nano, a Rotary Encoder, etc... Should be a complex yet fun project to build, and to show of the Power Of B4R!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please try the attached library. It is based on: https://github.com/adafruit/Adafruit-ST7735-Library

Example:
B4X:
Sub Process_Globals
   Public Serial1 As Serial
   Private st As AdafruitST7735
End Sub

Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   st.InitializeSoftware(10, 8, 11, 13, 9, 0) '0 = ST7735R green
   st.FillScreen(st.COLOR_BLACK)
   st.GFX.DrawCircle(10, 10, 10, st.COLOR_RED, True)
End Sub
 

Attachments

  • rAdafruit_ST7735.zip
    33.5 KB · Views: 411

Cableguy

Expert
Licensed User
Longtime User
It works "right-out-of-the-box" with a very minor glitch: My tft, although it has a green tab, selecting the option "0" in the initialize method show an "offset" of 2 pixels vertical and 1 pixel horizontal, plus the bal shows the color Blue.
I was already aware of some issues with this, and tried the option "2" (Blacktab) and it works as it should, no offset, and the Ball is Red!

Many Many Thanks @Erel, I got 2 gifts from today!
 

Cableguy

Expert
Licensed User
Longtime User
Trying to show text, I can show text in default white color, but I just can't figure out how to change its color.
I have tried:
st.GFX.DrawText("Hello World").ConfigureText(2, st.COLOR_CYAN, False)
but neither the text size nor the text color change
 

Cableguy

Expert
Licensed User
Longtime User
I did, but the IDE didn't like it... I will have to look deeper into it... I also have successfully used the "byte array/inline C" Bitmap into progmem code, the one with the smileys.
I will try to create a better looking image and post my TFT photo.
 

Cableguy

Expert
Licensed User
Longtime User
Try to call ConfigureText before you draw it.

As usual, you are absolutely right!

st.GFX.ConfigureText(1,st.COLOR_red,False)
st.GFX.DrawText("Hello World")

Works just fine!!!

No time to create an image worth showing!
 
Top