I'm writing a pico script where I can couple a digital input with a certain command over TCP.
To control a relais, I have to send a hexadecimal "string?": "\x55\xAA\x00\x03\x00\x02\x01\x06".
In the script below \x00 is a delimiter in the sprintf function.
Is there anyone who has more experience with picoC, who can help me?
char buffer2[1024];
sprintf(buffer2, ""\x55\xAA\x00\x03\x00\x02\x01\x06");
stream_write(TcpStream,buffer2,sizeof(buffer2"));
stream_flush(TcpStream);
sleep(5000);
stream_close(TcpStream);
Kommentar