Тёмный

Menu library for touch screens and/or mechanical buttons - ILI9341 displays 

Kris Kasprzak
Подписаться 20 тыс.
Просмотров 18 тыс.
50% 1

If you have a Teensy project that uses TFT displays with the either the ILI9341_t3 or the Adafruit_ILI9341 drivers, you may need some menu code. If you want to drive your menus with touch screen or mechanical buttons or encoders, this is the perfect library for you. This FREE code library will simplify creating and implementing a menu systems for microcontrollers and TFT displays such as the Teensy and ILI9341_t3 library or ESP32 and the Adafruit_9341 driver. This library includes two menu objects where you can use either or both:
1. A simple selection menu (ItemMenu) where the user can scroll up/down and select an item and some programmer defined action can be performed such as drawing a screen or activating a sub menu
2. A menu with in-line menu (EditMenu) where the user can scroll up/down the list and select an item however the difference is that move/up down on a selected item will scroll the values stored with that menu item and NOT scroll the list, selecting a selected item will restore control to moving up/down the menu list
Code and examples for ILI9341_t3 drivers (touch AND/OR mechanical buttons):
github.com/KrisKasprzak/ILI93...
Code and examples for Adafruit_ILI9341 drivers(touch OR mechanical buttons):
github.com/KrisKasprzak/Adafr...

Хобби

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 78   
@asifehsan4948
@asifehsan4948 12 часов назад
Dear sir, thanks for providing such a wonderful tutorial. I learn lot of things from your videos. I make a project with Esp32 tft display and add a function to control led on off using menu and it perfectly works. You have such a great knowledge. I am very happy. ❤❤❤❤
@KrisKasprzak
@KrisKasprzak 12 часов назад
Glad I could help!
@garyblackwood9459
@garyblackwood9459 9 дней назад
I must admit this looks really great, just what I was looking for. I had started on a simple settings menu of my own but it is just that very simple at the moment. Like you I used a list of objects each one specifying type, min, max values and increment plus a callback method to set the current value so its new value can be set while it is being changed and then on exit you decide to keep the new value or go back to the original value. I will try out your excellent library as it does so much more and no point in reinventing the wheel, thanks for sharing.
@DigitalDivotGolf
@DigitalDivotGolf 2 года назад
Thank you! Your videos are very helpful. I will try this library out and hopefully I can clean up my touch screen projects!
@KrisKasprzak
@KrisKasprzak 2 года назад
Glad it was helpful!
@khaledmaliaklanalbanna3586
@khaledmaliaklanalbanna3586 2 года назад
It's a great and helpful project. Thank you for your effort.
@NicholasRadina
@NicholasRadina Год назад
Well done! Thank you!
@KrisKasprzak
@KrisKasprzak Год назад
Glad it was helpful!
@FAR-SOFT
@FAR-SOFT 5 месяцев назад
i just started working with esp32 and tft, any link to an tutorial how to install this library on arduino ide? I looked for this library in the arduino ide library manager, but I couldn't find it.
@hamedtaran2102
@hamedtaran2102 Год назад
Thanks a lot 🙏
@KrisKasprzak
@KrisKasprzak Год назад
You're most welcome
@mitmicrocontroller475
@mitmicrocontroller475 Год назад
Sir, Is you used built in SPI pin?
@nomlas0803
@nomlas0803 Год назад
Nicely done! How do you suggest handling free text input, like SSID, password, etc? Using encoder to spin through the alphabet would be good enough for infrequently changed fields.
@KrisKasprzak
@KrisKasprzak Год назад
Thanks! One of the touch libraries has a keypad example for touch screens. while it only supports 0-9 as input I can see how this concept could be used to emulate a keyboard for keystroke input.
@carlosbarberis49
@carlosbarberis49 2 года назад
Although I think these menus you created are great, I don't see anyway to specify the SPI control signals for the ILI9341 TFT display as well as touch screen that comes with that display. I'm I missing something here? Thank you.
@KrisKasprzak
@KrisKasprzak 2 года назад
you pass in the display object so the lib can draw stuff. You use what ever touch lib you prefer and process touch accordingly.
@ThermaLTake94
@ThermaLTake94 Год назад
Greetings from greece kris!! what an awesome library,im using an esp32 with the tft_eSPI library,can i incorporate your library with what i already use?
@KrisKasprzak
@KrisKasprzak Год назад
You definitely will not be able to use this library directly. I took a quick look at the class definition and it’s very similar to the library I’m using. give me a week or so and I’ll see what it would take to port this over.
@user-ku5hi8ge6u
@user-ku5hi8ge6u 7 месяцев назад
Came across this and this looks to be exactly what i am looking to incorporate into my project. Will admit, I am very new to this space. My challenge so far is finding a capacitive touchscreen less than 3 inches. I found one on amazon that uses the ili9341v driver. I see your repo mentions ili9341_t3. Do you think there will be any compatibility issues? Curious what screen you are using in your video.
@KrisKasprzak
@KrisKasprzak 7 месяцев назад
If ili9341v uses the Adafrut_GFX library, my library can be adapted with around 10 lines of code changes. If the ili9341v does not use the Adafruit_GFX, this lib can't be used. I generally use displays like this www.amazon.com/DIANN-ILI9341-Display-320x240-Screen/dp/B0BNQBKFCT/ref=sr_1_4?crid=2KCRYW9FBAXRC&keywords=2.8%22%2BTFT&qid=1702491153&sprefix=2.8%2Btft%2Caps%2C81&sr=8-4&th=1 Also if you are using Arduinos, this lib will most likely not work--memory or other issues. I user Teensy 95% of the time ESP32 the other
@user-ku5hi8ge6u
@user-ku5hi8ge6u 7 месяцев назад
@@KrisKasprzak Thanks so much for the info! I’m reviewing your repo now! I placed my amazon order and cannot wait to try this out. If this works, you have solved for me what i have been scratching my head on for over 3 months!!! True life saver!!
@projetbandyakama3889
@projetbandyakama3889 Год назад
Hello; I'm working a 3.5 inch TFT with ILI 9488 as driver; how can I make the touch screen work with it and which library should I use?
@KrisKasprzak
@KrisKasprzak Год назад
What MCU are you using? This library could be easily adapted to work with other libraries provided they are based on the adafruit_GFX library. The read me posted on the kid hub page has a note on what he would need to edit.
@projetbandyakama3889
@projetbandyakama3889 Год назад
@@KrisKasprzak thanks for replaying ! I ´ m using Esp32 and my TFt 3.5 inch is on 8bit parallel mode (ILI9488) , it s work for display but I never found an adafruit library for touch.
@connalmcilwraith4367
@connalmcilwraith4367 Год назад
Hi - I think your menu looks fantastic and I'm really keen to incorporate it in my project. I am using an ESP32 and an rotary encoder and, according to your Git Hub page, your touch sensor for ESP32 should allow me to switch off the touch screen and use a mechanical input instead. However, I can't see any code for an encoder. Am I missing something? Keep up the good work, though!
@KrisKasprzak
@KrisKasprzak Год назад
I’ve got an example for an encoder I’ll post it soon
@connalmcilwraith4367
@connalmcilwraith4367 Год назад
@@KrisKasprzak thanks!
@KrisKasprzak
@KrisKasprzak Год назад
here you go! github.com/KrisKasprzak/Adafruit_ILI9341_Menu/tree/main/Examples/ESP32/ESP32_Menu_EncoderInput
@connalmcilwraith4367
@connalmcilwraith4367 Год назад
@@KrisKasprzak Fantastic! It works perfectly. Thanks so much.
@connalmcilwraith4367
@connalmcilwraith4367 Год назад
Hi - I've found one issue (not with your code) but I need to use a different screen driver, specifically tft_eSPI, as all my colours are inverted. However, if I do use the new driver, the compile stalls at the fonts because the eSPI driver expect the font in a different format. The menu.init in Adafruit_ILI9341_Menu.h is expecting 'setFont' and eSPI is expect 'setFreeFont' (I think). I've tried changing this (and many other pemutations) but I haven't had any success yet. Any suggestions? Thanks
@waynegalaugher5638
@waynegalaugher5638 Год назад
I have a TEENSY 3.2 with an Adafruit 2.8 TFT SPI Cap touch. I used your Pin defines but it won't compile I tried with a 4.1 teensy ; no joy. The teensy works with the display with Teensy 3.2 with simple sketch but no cap touch. I'm following the pin defines in the sketch. Getting close but no joy. I think it's the libraries that are killing things. Retrying on different computer!
@KrisKasprzak
@KrisKasprzak Год назад
Yikes I don't think the lib here will work with cap touch devices--different chip i'm sure.
@larbigueraiche6721
@larbigueraiche6721 11 месяцев назад
Good job. What is the difference between LED_PIN and PIN_LED in Mega2560_Menu_TouchInput.ino ? Thanks.
@KrisKasprzak
@KrisKasprzak 11 месяцев назад
probably a typo. either control the display on / off
@akhilavissomraju1245
@akhilavissomraju1245 Год назад
hey its an amazing video...can you share the connections between the display and the esp32 cuz whenever i run the code.. the display is white...i checked the connections in the user setup file of the ili9341 display and tried to connect it like that but its not working....thank you
@KrisKasprzak
@KrisKasprzak Год назад
I use the same pinout that is listed in the comment block in the example .ino. Can you even get the examples running that deliver with the Adafruit_ILI9341 library?
@akhilavissomraju1245
@akhilavissomraju1245 Год назад
@@KrisKasprzak sorry for the late reply..yes examples from adafruit_ILI9341 work but not the touch. can you tell me the touch pins connections to the esp. oh and also currently i am working with esp 32s2
@theunmannedcollectiv
@theunmannedcollectiv 7 месяцев назад
Is there any wiring schematic for your code? I think I had connected correctly but struggling to get things to work, Code has uploaded cleanly, yet no menu, it’s a beautiful project, hoping to get past square one, thank you!!
@KrisKasprzak
@KrisKasprzak 7 месяцев назад
Can you get any of the display driver examples to work?
@theunmannedcollectiv
@theunmannedcollectiv 7 месяцев назад
@@KrisKasprzak I had the drivers and test code working on my UNO but I am thinking I have something off in the MEGA is there was a fritzing or something I could check against?
@theunmannedcollectiv
@theunmannedcollectiv 7 месяцев назад
I have the screen working but which pins on Arduino Mega are T-DO, T-DIN-T-CS-T-CLK?
@theunmannedcollectiv
@theunmannedcollectiv 7 месяцев назад
ok, it is working sort of, touch works, screen and menu works, but touch is way off and after a few selections it goes to a screen flashing done in blue and red
@alanlautenslager7141
@alanlautenslager7141 Год назад
Yes I am just getting started with Arduino. Have a lot to learn at 75 years old. I have nothing but Arduinos from Nanos to Megas. Can I use this for Mega 2560? Is there a script available that I can look at and learn a lot from it? Thank you!
@KrisKasprzak
@KrisKasprzak Год назад
You can use this with a Mega2560, just make sure you use the Adafruit_ILI9341 display libraries and my Adafruit_ILI9341_Menu library. There are examples in both libs that can help you get started. I'd recommend getting the display working first
@alanlautenslager7141
@alanlautenslager7141 Год назад
@@KrisKasprzak Thank you for your reply. I guess I am looking for the script to enter into my IDE but cannot locate it or is this something I have to attempt to create? Like I said this is all new to me! :)
@alanlautenslager7141
@alanlautenslager7141 Год назад
Another question Kris - Again showing my lack of knowledge. If I understand your code is for a Teensy device? So if I use the Adafruit_ILI9341 librarys that makes it work with the Arduino?
@pieterveenders9793
@pieterveenders9793 Год назад
Much respect to you Alan, I'm 33 and fairly good with computers, yet still find my first steps into Arduino quite daunting. You're the living proof that you never stop learning!
@saydiy1528
@saydiy1528 Год назад
good job. what image convert app you used please?
@KrisKasprzak
@KrisKasprzak Год назад
javl.github.io/image2cpp/
@saydiy1528
@saydiy1528 Год назад
@@KrisKasprzak Thank you. did you try move the menu up/down by finger instaed of the arrow?
@kunkhmer5246
@kunkhmer5246 2 года назад
Hi Kris, will this library work with ILI9488 SPI?
@KrisKasprzak
@KrisKasprzak 2 года назад
Not as is. There are a few lines in the .h and .cpp you need to change to get it to work with the ILI9488 driver. Basically the obj definitions and the variable type. What MCU are you using?
@kunkhmer5246
@kunkhmer5246 2 года назад
@@KrisKasprzak Thank you Kris, I will give it a try.
@kunkhmer5246
@kunkhmer5246 2 года назад
@@KrisKasprzak I'm using ESP32 Dev. Module
@gaal8762
@gaal8762 2 месяца назад
Hello . Writes an error 'ILI9341_NAVY' was not declared in this scope 'ILI9341_DARKGREEN' was not declared in this scope 'ILI9341_DARKCYAN' was not declared in this scope 'ILI9341_MAROON' was not declared in this scope And a lot of this as well as 'elapsedMillis' does not name a type
@KrisKasprzak
@KrisKasprzak 2 месяца назад
It doesn’t sound like you’ve got the libraries installed.
@gaal8762
@gaal8762 2 месяца назад
@@KrisKasprzak Thank you, I understand, I found your other code for mega 2560. Another question: for mega 2560 you need to connect only these contacts ? #define T_CS 3 #define T_IRQ 2 #define TFT_DC 48 #define TFT_CS 53 #define TFT_RST 49 #define PIN_LED 26 Do I need to connect MISO to 50 end MOSI to 51 ? Where to connect #define LED_PIN 26 ?
@gaal8762
@gaal8762 2 месяца назад
@@KrisKasprzak Do you need matching resistors between the display and mega 2560?
@cooljackwi
@cooljackwi Год назад
Can i use both? The encoder and the Touch?
@KrisKasprzak
@KrisKasprzak Год назад
Someone else asked the same, I’ll take a look
@KrisKasprzak
@KrisKasprzak Год назад
I have updated the library to allow touch AND mechanical input. You can press menu items, then use something like and encoder to scroll through values. I have added an example for using Touch and and Encoder, noting that since you are having to trap encoder and touch, there is more processing code. Fortunately I was able to get both working w/o any method changes so this version should re-compile without errors. I have done a fair amount of testing, but if you see any issues, let me know. github.com/KrisKasprzak/ILI9341_t3_Menu Have fun..
@cooljackwi
@cooljackwi Год назад
@@KrisKasprzak i appreciate your work and will give it a try and let you know the outcome
@mitmicrocontroller475
@mitmicrocontroller475 Год назад
How to declare for SPI pin
@KrisKasprzak
@KrisKasprzak Год назад
You don’t the display manages that. Once you have the display object created, you passed the display object into this library.
@ipadize
@ipadize Год назад
does it work with ST7789?
@KrisKasprzak
@KrisKasprzak Год назад
What MCU are using?
@ipadize
@ipadize Год назад
@@KrisKasprzak Teensy 4.1
@JOHNSMITH-ug2mt
@JOHNSMITH-ug2mt Год назад
Ok, I'm a nooby...I have a mega2560, What Display would I use with this?
@KrisKasprzak
@KrisKasprzak Год назад
Can you set some parameters? What size display are you looking for? Do you want touch? While your options are limited to displays with the ILI9341 chip, you do have some choices. It’s hard to say without knowing much more.
@JOHNSMITH-ug2mt
@JOHNSMITH-ug2mt Год назад
@@KrisKasprzak 3.5 touchscreen if possible. thx!
Далее
кукинг с Даниилом 🥸
01:00
Просмотров 338 тыс.
Cheap and Easy to Use ESP32 Screen!
8:21
Просмотров 126 тыс.
ESP32 Web page creating and updating
32:11
Просмотров 148 тыс.
Arduino - Buttons on the TFT Touchscreen
29:10
Просмотров 43 тыс.
МОЖЕТ ЛИ УКУСИТЬ СОБАКА
0:14
Просмотров 2,9 млн
You can do it girl !! 👏👏
0:19
Просмотров 10 млн