TA的每日心情 | 开心 2021-3-15 10:18 |
---|
签到天数: 1027 天 连续签到: 1 天 [LV.10]以坛为家III
|
发表于 2013-9-4 22:33:41
|
显示全部楼层
你说的对,PCA8538数据手册是对的,参考示例程序有问题。
这个是我写,分享下:
//设置液晶屏驱动电压
void Set_VLCD(unsigned int value){
unsigned int tmp = 0x0000;
unsigned char dat = 0x00;
value = value & 0x01ff;//总共9位设置值
tmp = value;
tmp = tmp & 0xfff0;
tmp = tmp >> 4;
dat = (unsigned char)(tmp);
SPI_Write(WRITE_MODE,LAST_CTRL_BYTE,(0x40 | dat));
tmp = value;
tmp = tmp & 0x000f;
dat = (unsigned char)(tmp);
SPI_Write(WRITE_MODE,LAST_CTRL_BYTE,(0x60 | dat));
}
|
|