So I have a Touch screen TFT2.8 MEGA 2560, I followed the quick tutorial which gives booksellers to use to use the touch screen such as drawing on the screen and then display an image etc. .. (Here is the link: LCD Test | 2.8" TFT Touch Shield | Adafruit Learning System). Now, what I intend to do this is to display numbers from 0 to 9 and when you press a number of color changes, for example, the number 1 has a circle around it, the background is white, when you press 1 the background color turns black, and when you remove your finger from the screen color becomes white. Is there a tutorial or the library that do that?
I know what you want to do, but YOU need to code it yourself. I haven't looked at the library but it should have a way to see the raw touch values, and from there you can make a button function. That is of course if the library doesn't already have a button function.
Added: took a look that the library and it is VERY basic, also make sure you get this library too Adafruit_GFX otherwise it will not work.
It's OK, I've removed the THREE other identical posts.
(Actually there's another in the French section - I now understand the "booksellers" reference - well done, Google translate! )
PaulS : What I want to do is that I have a mini keyboard with keys ranging from 0 to 9. Each key has a contour that is circular (it may very well be square). For example, the 1 button is black and the background is white when pressed with your finger on the touch screen, button 1 becomes white and the background is black. It's simple, you press a button and the color changes and when removing the finger, the color returns to its initial state.
I don't quite understand the code that is given precisely, and wanted to know if there are tutorials that explain how it works.
HazardsMind : Ok ! How to see the raw touch values ? How to find the library with button function ? (Yes, search on internet, but I can't find :s )
You might want to download the UTFT libraries from Electronics - Henning Karlsen, as well as the UTouch library linked from the same page.
In the UTouch library folder, there's an example fof a 10-key + Enter + Clear touchscreen keypad.
Adafruit_GFX: Shapes TFTLCD Touchscreen library @Lar3ry henning's library doesn't work for all TFT screens, so the OP should use the one recommend by Adafruit.
I downloaded the libraries : UTFT, UTFT_Buttons and UTouch.
HazardsMind, the link that gave me Lar3ry, these libraries are compatible with my touch screen and I already Adafruit_GFX libraries and TFTLCD
I tried all examples of the library Utouch, but nothing happens after compiling..
In the program puts its: #include <UTFT.h> #include <UTouch.h>
So what I do is put the file UTFT.h in the folder UTouch.
PaulS : I meant the code given in the example of the library TFTLCD, one that allows you to write on the screen.
P.S. (Excuse me for spelling mistakes because I'm not English ^^)
This is from the keywords file in UTFT, these are all the "compatible" display models. You can go try your luck and go through each model and see if one works.
Sign_up_:
No, I I put the file UTFT.h in the folder UTouch because in code is written : #include <UTFT.h> #include <UTouch.h>
and as I want to use the example of UTouch, so I included the file UTFT.h in folder UTouch.
Yes I tried to use these codes, but his displays nothing and yet his compiles..
No idea what will happen if you include one library in another library's folder, but those two libraries should be separate, if you look in libraries, you should see a UTouch and a UTFT folder. When, in your sketch, you have an include statement, it wil look in the folder of that name, but without the .h on it. The .h file is in the folder.
HazardsMind : I have different models ( HX8347A - HX8352A ..etc) in UTFT library. It's really long to go through each model..
I don't understand how I can do ..
Sign_up_:
It's really long to go through each model..
It's even longer to not do it, because you'll never get it right. Yesterday I manually set the size of 200 database columns. Grunt work, and it sucks, but sometimes that's what programming is, and you just have to do it. Test all those types until you find the right one. Just do it and be done with it.
I just got one of these screens and I plan to use it to make a door lock - so I'll be doing the same thing myself, going through all the settings one by one to make sure they are correct. If I had an intern, they would be doing that, but I don't so I get to do it myself. Slogging through that kind of thing isn't fun, but it's necessary.
I was able to make my screen work today with just the basic demos. I can run the "paint" example. The calibration is a little off, but it works. I did not have to adjust any options anywhere - the libraries I'm using seemed to just work.
It's down at the bottom of the page where it says "Resources" - I installed both of those libraries from the zip. I was able to get the examples from the libraries to work, and I was able to get the sample code from the wiki page to work.
Please try doing that - erase everything else you've done first, then do exactly what I said on that page, try their sample code, and tell us if it works. At least then we'll have a known point to start from. When we figure out how to get the examples working for you, I will explain how to make a keypad.
HazardsMind : Screen resolution is 240x320
I tried all the models for that, I took a model (for example : SSD1289) located in UTFT -> tft_drivers -> SSD1289. Then I put the folder SSD1289 in UTouch, and after I launched a code example: UTouch_BouttonTest, I compile and it displays nothing. After trying all the models, I again but this time I included file.h of UTFT.h.
jasmine250 : On the site you gave me, I downloaded TFT Touch Shield libraries.zip (here is the link http://www.seeedstudio.com/wiki/File:TFT_Touch_Shield_libraries.zip ).
Then I tried the code given on the link you gave me, I also tried different example is in TFT but nothing works..
Are we sure these are the same screens? Probably not... can you post a link to the screen you bought? When you power it up, does the backlight come on? Are you using it as a shield or did you run cables to it? Reason I ask is because I'm using the UNO, and I think your 2560 has a different pin-out, right? Maybe the shield doesn't line up correctly with the 2560?
I am willing to Skype with you on this issue... because I think if we can get past this problem, you can help me with the keypad idea? If you can't do that, maybe post a short video showing your setup?