极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15041|回复: 1

求助,LCD12864显示问题

[复制链接]
发表于 2017-10-12 23:32:44 | 显示全部楼层 |阅读模式
想做一个测滑动电阻的装置。一个UNO板子和一个LCD12864模块。知道怎么获取模拟IO口的数据,但是怎么在LCD12864上显示出来,用的库是"LCD12864RSPI.h",后面不知道怎么编程了,请指教一下,谢谢大家,下面是代码。
/*
LCD  Arduino
PIN1 = GND
PIN2 = 5V
RS(CS) = 8;
RW(SID)= 9;
EN(CLK) = 3;
PIN15 PSB = GND;
*/

#include "LCD12864RSPI.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )

unsigned char show0[]={0xB5,0xE7,0xD7,0xE8,0xD7,0xE8,0xD6,0xB5};//电阻阻值
unsigned char show1[]="A0:";
unsigned char show2[]="A1:";
unsigned char show3[]="A2:";
unsigned char show4[]="A3:";
unsigned char show5[]="A4:";
unsigned char show6[]="A5:";

void setup()
{
LCDA.Initialise(); // 屏幕初始化
delay(100);
}

void loop()
{
LCDA.CLEAR();//清屏

int A0=analogRead=(A0); //读取UNO上的6个模拟IO口的数据并转成整数
int A1=analogRead=(A1);
int A2=analogRead=(A2);
int A3=analogRead=(A3);
int A4=analogRead=(A4);
int A5=analogRead=(A5);

delay(100);
LCDA.DisplayString(0,2,show0,AR_SIZE(show0));//第一行第三格开始,显示文字电阻阻值
delay(100);
LCDA.DisplayString(1,0,show1,AR_SIZE(show1));//第二行第一格开始,显示“A0”
delay(100);
LCDA.DisplayString(1,4,show2,AR_SIZE(show2));//第二行第五格开始,显示“A1”
delay(100);
LCDA.DisplayString(2,0,show3,AR_SIZE(show3));//
delay(100);
LCDA.DisplayString(2,4,show4,AR_SIZE(show4));//
delay(100);
LCDA.DisplayString(3,0,show5,AR_SIZE(show5));//
delay(100);
LCDA.DisplayString(3,4,show6,AR_SIZE(show6));//
delay(5000);

}
回复

使用道具 举报

发表于 2018-4-10 21:48:57 | 显示全部楼层
请问在编译时,是否出现以下故障提示:'LCDA' was not declared in this scope?若有,请问如何解决的?谢谢!
回复 支持 反对

使用道具 举报

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

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-3-28 19:39 , Processed in 0.041886 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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