Hi guys,
After copying and pasting hundreds lines of codes and 30 odd libraries from the internet I've come to the conclusion I have no idea what I'm doing. I have manage so far to print 5 lines of text on my lcd screen which to me was a massive achievement.
This is the hardware I'm using:
Screen kuman 3.5 TFT Touch Screen with SD Card Socket for Arduino touch display compatible R3 Board with Touch Function SC3A-1 https://www.amazon.co.uk/dp/B075CXXL1M/ref=cm_sw_r_apan_glt_fabc_5D9AJHY8ZYA0GG340SKH?_encoding=UTF8&psc=1
Controller ELEGOO UNO R3 Project Super... https://www.amazon.co.uk/dp/B01D8KOZF4?ref=ppx_pop_mob_ap_share
This is the code that has worked for printing 5 lines on the lcd:
/***********************************************************************************
*This program is a demo of displaying string
*This demo was made for LCD modules with 8bit or 16bit data port.
*This program requires the the LCDKIWI library.
* File : display_string.ino
* Hardware Environment: Arduino UNO&Mega2560
* Build Environment : Arduino
*Set the pins to the correct ones for your development shield or breakout board.
*This demo use the BREAKOUT BOARD only and use these 8bit data lines to the LCD,
*pin usage as follow:
* LCD_CS LCD_CD LCD_WR LCD_RD LCD_RST SD_SS SD_DI SD_DO SD_SCK
* Arduino Uno A3 A2 A1 A0 A4 10 11 12 13
*Arduino Mega2560 A3 A2 A1 A0 A4 10 11 12 13
* LCD_D0 LCD_D1 LCD_D2 LCD_D3 LCD_D4 LCD_D5 LCD_D6 LCD_D7
* Arduino Uno 8 9 2 3 4 5 6 7
*Arduino Mega2560 8 9 2 3 4 5 6 7
*Remember to set the pins to suit your display module!
*
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, QD electronic SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
**********************************************************************************/
#include <LCDWIKI_GUI.h> //Core graphics library
#include <LCDWIKI_KBV.h> //Hardware-specific library
//if the IC model is known or the modules is unreadable,you can use this constructed function
LCDWIKI_KBV mylcd(ILI9486,A3,A2,A1,A0,A4); //model,cs,cd,wr,rd,reset
//if the IC model is not known and the modules is readable,you can use this constructed function
//LCDWIKI_KBV mylcd(320,480,A3,A2,A1,A0,A4);//width,height,cs,cd,wr,rd,reset
//define some colour values
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
void setup()
{
Serial.begin(9600);
mylcd.Init_LCD();
Serial.println(mylcd.Read_ID(), HEX);
mylcd.Fill_Screen(BLACK);
}
void loop()
{
mylcd.Set_Rotation(3);//display rotation
mylcd.Set_Text_Mode(1);
//display line 1 string
mylcd.Fill_Screen(0x0000);//change the backgroung colour
mylcd.Set_Text_colour(GREEN);//change colour of text
mylcd.Set_Text_Back_colour(BLACK);
mylcd.Set_Text_Size(4);//change text size
mylcd.Print_String("UFC 305.00 STPT 2", 0, 10);//writes text and where it prints on screen
//display line 2 string
mylcd.Set_Text_colour(GREEN);
mylcd.Set_Text_Size(4);
mylcd.Print_String("UFC 305.00 STPT 2", 0, 80);
//display line 3 string
mylcd.Set_Text_colour(GREEN);
mylcd.Set_Text_Size(4);
mylcd.Print_String("UFC 305.00 STPT 2", 0, 150);
//display line 4 string
mylcd.Set_Text_colour(GREEN);
mylcd.Set_Text_Size(4);
mylcd.Print_String("UFC 305.00 STPT 2", 0, 210);
//display line 5 string
mylcd.Set_Text_colour(GREEN);
mylcd.Set_Text_Size(4);
mylcd.Print_String("UFC 305.00 STPT 2", 0, 270);
delay(9000);
}
So obviously I know this has no benefit to using dcs bios. I just wanted to see how the screen would look.
My plan its to have dcs bios to print on the lcd screen to make a ded screen but I don't know what code to use.
From dcs bios
void onDedLine1Change(char* newValue) {
/* your code here */
}
DcsBios::StringBuffer<25> dedLine1Buffer(0x44fc, onDedLine1Change);
I've been trying for the last month with different lines of code and different libraries but nothing seems to work for me. Can someone help me with an example of what to input so I can get the result I'm after.
Thanks
RED