Using a Uno R3 to communicate with a Noritake VFD display that uses RS232 serial, so I used the SoftwareSerial port with Inverted signal option. So far, so good - display understand basic text.
But I think I'm doing something wrong setting up variable constants to send escape commands for special features on the display... One command sequence needs to send the following hex codes that I defined using char:
char FONT_MAG_X1Y2[] = {0x1F + 0x28 + 0x67 + 0x40 + 0x01 + 0x02};
later in my code, I refence that string via:
mySerial.write(FONT_MAG_X1Y2);
but the display is not processing that command string correctly. I know for a fact that this command string is correct because I have a Noritake demo utility that generates the identical code string and it works using a USB to serial adapter. My Ardunio code must not be sending the same data for some reason. I notice that if I hover over the FONT_MAG_X1Y2 reference in the myserial.write line a popup box shows the string definition buit also says:
variable FONT_MAG_X1Y2
Type: char[1]
Value = {-15}
Passed as str
char FONT_MAG_X1Y2[] = {0x1F + 0x28 + 0x67 + 0x40 + 0x01 + 0x02}
Which leads me to think that perhaps the compiler is interpreting that as some calculation and sending -15 to the display over the serial port.
Any thoughts? Am I defining my strings correctly?
Edit - I've Googled for hours trying to solve this on my own but that just makes me more confused. So many discussions about char vs string etc. And I can't find a good example of concatenating ascii hex codes in C.
TIA