R
Richard Müller
Good morning everybody,
I want to send imprintable characters to a serial LCD device, represented
by their ASCII-value (dec. or hex). For example to clear the screen I
have to send the character with its decimal value of 43. As far as I have
learnt, C++ doesn't know the chr$(43) style. By searching the internet I
found the following solution:
-----------------
int cls = 43;
....
wr=write(fd1, char(cls), 1); //fd1 is the opened display
-----------------
By compiling with g++ (linux) I get:
neuer:/home/richard/prog_PAR # g++ demo_write.cpp
demo_write.cpp: In function ‘int main()’:
demo_write.cpp:30: error: invalid conversion from ‘char’ to ‘const void*’
demo_write.cpp:30: error: initializing argument 2 of ‘ssize_t write
(int, const void*, size_t)’
How do I send the ASCII codes to fd1?
Thanks for helping -
Richard
I want to send imprintable characters to a serial LCD device, represented
by their ASCII-value (dec. or hex). For example to clear the screen I
have to send the character with its decimal value of 43. As far as I have
learnt, C++ doesn't know the chr$(43) style. By searching the internet I
found the following solution:
-----------------
int cls = 43;
....
wr=write(fd1, char(cls), 1); //fd1 is the opened display
-----------------
By compiling with g++ (linux) I get:
neuer:/home/richard/prog_PAR # g++ demo_write.cpp
demo_write.cpp: In function ‘int main()’:
demo_write.cpp:30: error: invalid conversion from ‘char’ to ‘const void*’
demo_write.cpp:30: error: initializing argument 2 of ‘ssize_t write
(int, const void*, size_t)’
How do I send the ASCII codes to fd1?
Thanks for helping -
Richard