send characters to 635

deltaxfx

New member
I am modifying the linux C code example for the 635 to help me gain an understanding of how it works. but i am stuck with some of the code.

Code:
outgoing_response.command = 31;
outgoing_response.data[0]=0; //col
outgoing_response.data[1]=0; //row
memcpy(&outgoing_response.data[2],">>>This is line 1<<<",20);
outgoing_response.data_length = (22);
send_packet();
The above works fine and outputs:
>>>This is line 1<<<
I changed the program so that part of the code is now a module and i can send text to it like:

Code:
char text_send[] = "some text"
outgoing_response.command = 31;
outgoing_response.data[0]=0; //col
outgoing_response.data[1]=0; //row
memcpy(&outgoing_response.data[2],text_send,9);
outgoing_response.data_length = (11);
send_packet();
Again the above works fine and outputs:
some text

But what I am really after is sending characters to the 635, one character at a time, and use a for loop to write them across the rows. but i am hung up. this is what i tried:

Code:
char text_send[] = ">>>This is line 1<<<";
char text_single;
text_single = text_send[3];
outgoing_response.command = 31;
outgoing_response.data[0]=0; //col
outgoing_response.data[1]=0; //row
memcpy(&outgoing_response.data[2],text_single,1);
outgoing_response.data_length = (2 + 1);
send_packet();
i would think that should send one character (the "T" if im not mistaken) to the display, but when i try to MAKE i get this error:

test635.c: In function ‘int main(int, char**)’:
test635.c:75: error: invalid conversion from ‘char’ to ‘const void*’
test635.c:75: error: initializing argument 2 of ‘void* memcpy(void*, const void*, size_t)’
make: *** [test635.o] Error 1

any help in resolving this would be greatly appreciated.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad

CF Tech

Administrator
Give this a try:
Code:
char text_send[] = ">>>This is line 1<<<";
outgoing_response.command = 31;
outgoing_response.data[0]=0; //col
outgoing_response.data[1]=0; //row
outgoing_response.data[2]=text_send[3];
outgoing_response.data_length = (2 + 1);
send_packet();
 
Top