我正在尝试使用液晶库在16x2液晶显示器上打印文本,但是液晶显示器没有给出任何响应。代码很简单,但在我的情况下不起作用:
#include <LiquidCrystal.h>
#include <Servo.h>
//Digital pins
const int d_pin_lcd_D7 = 2, d_pin_lcd_D6 = 3, d_pin_lcd_D5 = 4,
d_pin_lcd_D4 = 5, d_pin_switch = 6, d_pin_button = 7, d_pin_led_green = 8,
d_pin_led_yellow = 9, d_pin_led_red = 10,
d_pin_lcd_EN = 11, d_pin_lcd_RS= 12, d_pin_servo = 13;
// Analog pins
const int a_pin_a = 0;
LiquidCrystal lcd(d_pin_lcd_RS, d_pin_lcd_EN, d_pin_lcd_D4, d_pin_lcd_D5, d_pin_lcd_D6, d_pin_lcd_D7);
void setup()
{
//LCD setup
lcd.begin(16, 2);
lcd.print("Hello world!");
}
void loop()
{
}
请记住,我仍然是Arduino的初学者,所以我可以获得更多信息!电路板设置可能有问题,但我几乎复制了16x2 lcd显示器设置的Arduino示例,包括10 kOhm电位器。提前谢谢!