I wish you a good day people. I'd like to aska question concerning comminucation between arduino and VS2008 c++.
I started making a project as it is indicated in playground as a simple window forms app. I've imported serialPort object and made a small program where arduino lights LEDs up when it receives letters a, b, c. Nothing fancy but i'm just a starter.
Then i tried to make my VS app listen to what arduino has to say and encountered a series of problems. At the end i menaged to get some data to VS off of arduino board but data is fragmented...
I'm using example file AnalogInOutSerial which reads the state of potentiometer and dims the diode using PWM, sending scaled data back through the USB. When i open the serial monitor data lokks like this:
sensor = 0 output = 0
but then i try to read data to the visual studio i get fragmented words and numbers... sometimes i get it right but that is a coincidence i guess. i get combination od first two words i get sensor with two ss i get just the end of the word :S This is my code for receiving data it is activated with a windows button
this->serialPort1->PortName = "COM3";
this->serialPort1->Open();
String^ message = this->serialPort1->ReadLine();
this->serialPort1->Close();
this->label1->Text = message;