ArduinoMenu icon indicating copy to clipboard operation
ArduinoMenu copied to clipboard

How can I use MCUFRIEND_kbv as an output for ArduinoMenu?

Open vikulin opened this issue 4 years ago • 5 comments

I have 3.5" UNO Module which I would like to use together with ArduinoMenu. I did find MCUFRIEND_kbv library. How can I use this lib?

Board: Arduino Uno

TFT spec: Driver: ILI9486 Dots:320x480 Bus:8bit Touch:No

vikulin avatar Dec 07 '19 10:12 vikulin

you can issue navigation commands to the navigation root instead on depending on full automation, this example is about it: https://github.com/neu-rah/ArduinoMenu/blob/master/examples/codeCtrl/codeCtrl/codeCtrl.ino

please note the usage of NONE on the input definition... only needed if using the macros (see nomacros example)

neu-rah avatar Dec 07 '19 10:12 neu-rah

sorry, you talking about input, right? using the display... it is compatible with adafruit GFX, therefor it could be used as so

neu-rah avatar Dec 07 '19 10:12 neu-rah

Thanks for quick answer. GFX should be used with hardware specific lib. Such as TFT or MCUFRIEND_kbv. I found an example for UTFT lib and some more. I'm looking for an example for mentioned MCUFRIEND_kbv lib because it's working for Uno board oppositely to UTFT which requires Mega.

сб, 7 дек. 2019 г. в 12:51, Rui Azevedo [email protected]:

sorry, you talking about input, right? using the display... it is compatible with adafruit GFX, therefor it could be used as so

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neu-rah/ArduinoMenu/issues/267?email_source=notifications&email_token=AAFVRRQFQGATQYGVMC6C7G3QXN523A5CNFSM4JXLDCLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGGD7YA#issuecomment-562839520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFVRRQYIWI5YAEOVUC2TW3QXN523ANCNFSM4JXLDCLA .

vikulin avatar Dec 07 '19 11:12 vikulin

you are welcome, we have also a chat room https://gitter.im/ArduinoMenu/Lobby

if a the display driver is nor yet supported we can add a menu output driver for it, its not hard, menuIO folder contains some, usually i start with the most similar and adapt from it

neu-rah avatar Dec 07 '19 11:12 neu-rah

Hello vikulin. If you are using the 3.5 inch ILI9846 TFT-LCD, just add the following to your sketch.

#define LCD_CS A3 // Chip Select goes to Analog 3 #define LCD_CD A2 // Command/Data goes to Analog 2 #define LCD_WR A1 // LCD Write goes to Analog 1 #define LCD_RD A0 // LCD Read goes to Analog 0 #define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin #include "Adafruit_GFX.h" #include <TFT_HX8357GLUE.h> TFT_HX8357GLUE tft; #ifndef AVR #include <avr/dtostrf.h> #endif

The TFT_HX8357GLUE.h loads the MCUFIEND_kbs library for you and it is part of the MCUFRIEND_kbv-master download bundle.

This TFT-LCD was developed to be used as an Arduino UNO shield; therefore, the access to the on-board SD card is seamless on the UNO. If you want to use this TFT-LCD on the Arduino MEGA-2560 and on top of that you'd like to use the so mentioned on-board SD slot, you must use SoftSPI to bit-bang the none-ISP pins on the MEGA. To use this SoftSPI version, just add the following to your sketch:

#include <SPI.h> // f.k. for Arduino-1.5.2 #define USE_SDFAT. // SDFAT allows the use of SoftSPI #include <SdFat.h> // Use the SdFat library SdFatSoftSpi<12, 11, 13> SD; // Bit-Bang on the Shield pins #define SD_CS 10 // Chip select for the SD

Evidently, do not forget to download and to install the required libraries.

Last, but not least, just initialize the TFT-LCD and the SD instances by adding the following to your code's void setup(): tft.begin();
SD.begin(SD_CS);

These additions will allow you to use your TFT-LCD along with all the examples provided in the MCUFRIEND_kbv-master download package.

Then you can start building your menu by using the adafruitGfx/tft/tft.ino example that comes in the ArduinoMenu library bundle.

I'll be more than willing to help you if you need further assistance on using this TFT-LCD.

Best regards...

NeftaliLoya avatar May 21 '20 04:05 NeftaliLoya