新人刚入手开始学习,想实现一个字符闪烁的效果,但不知道那四条横线是从哪来的?
就在OK 后面,应该能看清
代码如下
#include <LiquidCrystal.h>
#define button1 A0
#define button2 A1
#define button3 A2
#define button4 A3 int KEY_NUM = 0; //按键键值存放变量,不等于1说明有按键按下
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{ lcd.begin(16,2); //初始化LCD1602 lcd.print("Welcome to use!"); delay(1000); //延时1000ms lcd.clear(); //液晶清屏 pinMode(button1,INPUT_PULLUP); pinMode(button2,INPUT_PULLUP); pinMode(button3,INPUT_PULLUP); pinMode(button4,INPUT_PULLUP);
}
void loop()
{ lcd.setCursor(0,0); lcd.print(" Exm1 Exm2 Exm3 "); lcd.setCursor(0,1); lcd.println(" OK"); lcd.setCursor(12,1); lcd.println("NO "); delay(1000); lcd.setCursor(0,0); lcd.print(" Exm2 Exm3 "); lcd.setCursor(0,1); lcd.println(" OK"); lcd.setCursor(12,1); lcd.println("NO "); delay(1000);
}

