Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use MCUFRIEND_kbv as an output for ArduinoMenu? #267

Open
vikulin opened this issue Dec 7, 2019 · 5 comments
Open

How can I use MCUFRIEND_kbv as an output for ArduinoMenu? #267

vikulin opened this issue Dec 7, 2019 · 5 comments

Comments

@vikulin
Copy link

vikulin commented Dec 7, 2019

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

@neu-rah
Copy link
Owner

neu-rah commented Dec 7, 2019

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
Copy link
Owner

neu-rah commented Dec 7, 2019

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

@vikulin
Copy link
Author

vikulin commented Dec 7, 2019 via email

@neu-rah
Copy link
Owner

neu-rah commented Dec 7, 2019

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

@NeftaliLoya
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants