Hello, I am very new to the Arduino world and am having trouble getting the C++ interface to work properly. The code for the arduino is
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.println("Hello World");
delay(1000);
}
This just outputs the phrase "Hello World" over and over and over again, once ever second. I'm trying to write a C++ program to input data from the USB port, such that it displays "Hello World" once a second, synced with the Arduino. I'm getting a return of -1 for status, and I'm not reading the data. I'm trying to use the C++ library availible from the Software Interfacing section of Playground. Here's the C++ snippet, hopefully someone can tell me what I'm doing wrong. It's probably a very nooby mistake.
char *buffer = "";
int status = 0;
Serial test(LPCWSTR("COM4"));
while(1)
{
status = test.ReadData(buffer, 11);
printf("Port Says: %s\n", buffer);
printf("Status = %i", status);
Sleep(1000);
}