diff --git a/esp32c3_code/esp32c3_code.ino b/esp32c3_code/esp32c3_code.ino index d20b486..51562a8 100644 --- a/esp32c3_code/esp32c3_code.ino +++ b/esp32c3_code/esp32c3_code.ino @@ -3,7 +3,7 @@ void setup() { // put your setup code here, to run once: - + //delay(1000); lcd_init(); diff --git a/esp32c3_code/lcd.cpp b/esp32c3_code/lcd.cpp index b76cc9c..d6f4205 100644 --- a/esp32c3_code/lcd.cpp +++ b/esp32c3_code/lcd.cpp @@ -35,7 +35,7 @@ void LCD_Writ_Bus(uint8_t dat) ******************************************************************************/ void LCD_WR_DATA8(uint8_t dat) { - digitalWrite(LCD_DS,1);//写数据 + LCD_Writ_Bus(dat); } @@ -47,9 +47,10 @@ void LCD_WR_DATA8(uint8_t dat) ******************************************************************************/ void LCD_WR_DATA(uint16_t dat) { - digitalWrite(LCD_DS,1);//写数据 - LCD_Writ_Bus(dat>>8); - LCD_Writ_Bus(dat); + + //LCD_Writ_Bus(dat>>8); + vspi->transfer16(dat); + } @@ -62,6 +63,7 @@ void LCD_WR_REG(uint8_t dat) { digitalWrite(LCD_DS,0);//写命令 LCD_Writ_Bus(dat); + digitalWrite(LCD_DS,1);//写数据 } /****************************************************************************** @@ -120,9 +122,11 @@ void LCD_Address_Set(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2) void Lcd_Init(void) { -//************* Start Initial Sequence **********// +//************* Start Initial Sequence **********// +//delay(120); //LCD_WR_REG(0x01); -//delay(100); +//上电后硬件会自己复位 +delay(220); LCD_WR_REG(0x36); if(USE_HORIZONTAL==0)LCD_WR_DATA8(0x00); else if(USE_HORIZONTAL==1)LCD_WR_DATA8(0xC0); @@ -199,7 +203,7 @@ LCD_WR_DATA8(0x23); LCD_WR_REG(0x21); LCD_WR_REG(0x11); -//Delay (120); +delay(120); LCD_WR_REG(0x29); } diff --git a/esp32c3_code/lcd.h b/esp32c3_code/lcd.h index a935593..8411a17 100644 --- a/esp32c3_code/lcd.h +++ b/esp32c3_code/lcd.h @@ -18,7 +18,7 @@ #define USE_HORIZONTAL 0 //设置横屏或者竖屏显示 0或1为竖屏 2或3为横屏 #define LCD_W 240 -#define LCD_H 240 +#define LCD_H 320 #define OLED_CMD 0 //写命令 #define OLED_DATA 1 //写数据 diff --git a/lichuang_pcb/lichuang_eda.eprj2 b/lichuang_pcb/lichuang_eda.eprj2 index 6e0ee17..307314a 100644 Binary files a/lichuang_pcb/lichuang_eda.eprj2 and b/lichuang_pcb/lichuang_eda.eprj2 differ