Note: I use Visual C++ 2005
I would like to read the received character from the serial port (e.g. 'a', 'b', ...). Instead I get the ASCII code of the character I received (97, 98, ...). Here's the code I use:
//defining the serial port
System::IO:orts::SerialPort^ mySerialPort;
...
//in the function
String^ string;
cli::array<unsigned char>^ buffer;
buffer = gcnew <unsigned char>(1);
mySerialPort->Open();
mySerialPort->Read(buffer,0,1);
string += buffer->getValue(0);
MessageBox::Show(string,"Character received");
Thanks for your Help
I would like to read the received character from the serial port (e.g. 'a', 'b', ...). Instead I get the ASCII code of the character I received (97, 98, ...). Here's the code I use:
//defining the serial port
System::IO:orts::SerialPort^ mySerialPort;
...
//in the function
String^ string;
cli::array<unsigned char>^ buffer;
buffer = gcnew <unsigned char>(1);
mySerialPort->Open();
mySerialPort->Read(buffer,0,1);
string += buffer->getValue(0);
MessageBox::Show(string,"Character received");
Thanks for your Help