lcd1602-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2035|回复: 4

[未解决] lcd1602

[复制链接]
发表于 2021-8-19 21:04 | 显示全部楼层 |阅读模式
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
[mw shl code=applescript,true];
LiquidCrystal_I2C lcd(0x27,16,2);
#if defined(ARDUINO) && ARDUINO >= 100
#define printByte(args)  write(args);
#else
#define printByte(args)  print(args,BYTE);
#endif
uint8_t a[8]= {0x04,0x04,0x04,0x07,0x04,0x04,0x04,0x1F,};
uint8_t b[8]= {0x08,0x08,0x0E,0x14,0x04,0x1F,0x04,0x04,};
uint8_t c[8] = {0x1F,0x04,0x04,0x06,0x05,0x04,0x04,0x04,};
uint8_t d[8] = {0x1F,0x04,0x1F,0x15,0x1F,0x15,0x1F,0x15,};
uint8_t e[8] = {0x1F,0x01,0x02,0x04,0x04,0x04,0x04,0x0C,};
void setup(){
  lcd.init();
  lcd.backlight();
  lcd.createChar(0, a);
  lcd.createChar(1, b);
  lcd.createChar(2, c);
  lcd.createChar(3, d);
  lcd.createChar(4, e);
  lcd.setCursor(0,0);
  lcd.printByte(0);
  lcd.printByte(1);
  lcd.printByte(2);
  lcd.printByte(3);
  lcd.printByte(4);
  }
void loop(){
}
[/mw shl code]

Arduino:1.8.9 (Windows 10), 开发板:"Arduino/Genuino Uno"

sketch_aug18a:3:1: error: expected unqualified-id before '[' token

[mw shl code=applescript,true];

^

sketch_aug18a:32:1: error: expected unqualified-id before '[' token

[/mw shl code]

^

exit status 1
expected unqualified-id before '[' token

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。



 楼主| 发表于 2021-8-19 21:34 | 显示全部楼层
已解决,但在删除[wm shl……]后屏幕空白
发表于 2022-3-11 14:39 | 显示全部楼层
宽宽cjh2 发表于 2021-8-19 21:34
已解决,但在删除[wm shl……]后屏幕空白

免费参考,禁止转载

ardyino.zip

4.97 KB, 下载次数: 1

程序文件

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-1 09:06 , Processed in 0.085656 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表