stooged / dWin

Arduino Dwin LCD Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dwin lib

RAMNIWASD opened this issue · comments

commented

pls help
dear sir
I tried this library with Arduino and Dwin display to communicate with each other
I facing some problems. the function does not work properly

(Serial.println(dwin.read_vp(0x0A00)); // read a value from a set vp)

and want to add a function in the library to read serial boolean data from touching the dwin display (key VP and Key value ) with the library function
can you update this library (Thanks in Advance )

/////////////////*
char* dWin::read_vp(uint16_t Addr) {
uint8_t tmpDat[7] = { FrameHeader >> 8, FrameHeader, 4, VarAddr_R, Addr >> 8, Addr, 0x01 };
this->Var.T5L_Serial->write(tmpDat, sizeof(tmpDat));
this->Var.T5L_Serial->flush();
delay(10);
if (this->Var.T5L_Serial->available() > 0) {
uint8_t Length = this->Var.T5L_Serial->available();
char Data[Length];
for (int i = 0; i <= Length; i++) {
Data[i] = this->Var.T5L_Serial->read();
}
if ((Data[0] << 8) | Data[1] == FrameHeader) {
static char rData[255];
strcpy(rData, Data);
return rData;
}
}
return NULL;
}
////////////////////////////////////