I have a 3.95 '' TFT which works nicely with all the examples they provide after installing these libraries: https://github.com/prenticedavid/MCUFRIEND_kbv
Can you make it work in B4R as well ? I tried the above and it does not recognize the device.
Thanks
I can't see any use except for graphics since all the pins are used by the shield...
If you can include drawing, text, Bitmaps it will be great !
I also tried to put it on WEMOS, changing the CS pin to A3 but it is not enough. Working with WEMOS would be great - then I'll be able to use it as the screen to the clock instead of the 1602 LCD, or as a command panel to the IOT's at home.
So - if you can include the parts that allocate the pins to the LCD maybe it will work.
Thank you for the efforts you invest, you should learn to say NO sometimes...
BTW - the photos that I copied from the other thread disappeared !
Try the attached library.
You need to add a reference to rAdafruitGFX library.
The library was not tested.
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private mcu As MCUFRIEND_kbv
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim p As Pin 'ignore
mcu.Initialize(p.A3, p.A2, p.A1, p.A0, p.A4)
mcu.GFX.DrawCircle(10, 10, 10, mcu.COLOR_GREEN, True)
End Sub
I've just re-visited this thread, thank you Erel, it works !
Can you tell which of the IO pins is not used by the TFT (to be able to connect to other parts/devices) ?
I have checked the printed board on the back of the screen and saw few unconnected pins.
I connected all pins to arduino UNO by wires instead of direct plug-in, then checked the suspected pins.
Pins 0,1,A5 are free to use !
Now I connected a WEMOS by softserial to pins 0,1 (unable to load program when connected, so for loading - disconnect them)
The WEMOS provides time from NIST and the UNO displays it :
EDIT: As the WEMOS just sends data and the UNO just receives data, it is sufficient to connect just one wire from the TX pin of the wemos to RX pin of the UNO (pin D0). With that connection logic conversion is not required (the UNO reads 3.3v as high).
Additional features to the library will be useful and much appreciated:
- get touched point, to be able to create buttons for UI by the screen.
- Rotate to landscape.
not that there is much space left for more code...
Dear friends,
Is there any support for touch inputs? If yes, how to to implement the same?
regards,
PS: this issue seems to be raised by derez!
Probably the touch functionality needs the Touch Screen Library. The attached library for Arduino works.Hence requesting the "brains" to wrap it for B4R!
After the success with the 3.95 TFT and the library I purchased another TFT but couldn't get the 3.95 so I bought 3.5 inch.
It uses the same shield like the first but the colors where all mixed up and the text was written like in a mirror...
I did some guessing and came out with the following corrections:
1. Edit the MCUFRIENDS_kbv.cpp file with this (line 1623 in notepad++)
Checking again the io pins I found that pins 0,1 ,10-13 , A5 are not used by the TFT so they are usable for other tasks. pins 0,1 are used for the ide interface so if used for connection with other boards as HW serial - don't use logging during runtime.