I've got a clarification question regarding the receiving of data from across a serial port from an Arduino. Specifically, I'm using a Sparkfun Pro Micro 5v/16MHz and trying to write a simple GUI in C++ to send messages over the serial port and then receive one of a few responses that are specified in the code running on the Arduino board.
I know the communication and code running on the Arduino works because I have tried using the Serial Monitoring tool in the Arduino IDE and am able to send and receive the appropriate responses.
When sending messages through the C++ GUI I've created I see the traffic LED blinking on message send leading me to believe that send via C++ GUI is working, but nothing regarding receiving messages works.
Some of my code:
private: System::Void serialPort1_DataReceived(System::Object^ sender, System::IO::Ports::SerialDataReceivedEventArgs^ e)
{
String^ testStr = serialPort1->ReadExisting();
log_textBox->Text += testStr + "\n";
}
It's a very simple event handler that is assigned to the DataReceived
event of my SerialPort
object that is part of my form. I've set a breakpoint inside of it, and it never gets triggered. I'm kind of at a loss, I've done a nonexistent amount of work with Arduino or hardware so I'm not entirely sure what my options are for debugging.
If anyone has any debugging suggestions or ideas what I'm doing wrong I would very much appreciate it. Additionally, if I haven't provided any information let me know what is needed and I'll edit it in!
Thank You, -K