Okay. Thank you for clearing that up. That makes more sense than it returning a char. I didn't know what a pointer was but now that you have explained that it makes sense. The other question I have is if you think I would need to send both Brain.readErrors and readCSV. I think I do.
Here is the updated code.
/*
SimpleSend
This sketch transmits a short text message using the VirtualWire library
connect the Transmitter data pin to Arduino pin 12
*/
char *Brainmsg;
#include <VirtualWire.h>
#include <Brain.h>
// Set up the brain parser, pass it the hardware serial object you want to listen on.
Brain brain(Serial);
void setup(){
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
Serial.begin(9600);
}
void loop(){
if (brain.update()) {
Brainmsg = brain.readErrors();
digitalWrite(13, true); // Turn on a light to show transmitting
vw_send((uint8_t *)Brainmsg, strlen(Brainmsg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false); // Turn off a light after transmission
Serial.println(brain.readErrors());
Brainmsg = brain.readErrors();
digitalWrite(13, true); // Turn on a light to show transmitting
vw_send((uint8_t *)Brainmsg, strlen(Brainmsg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false); // Turn off a light after transmission
Serial.println(brain.readCSV());
}
}
I am now going to create a fake array that I can test with this. The question I have is , is this an array of numbers stored as chars. I just seems weird that it is exporting it as a char array instead of the values. And they are comma delineated.
Here is how I was planning on creating fake brain data for testing. Would this work?
char *Brainmsg;
String braindata = Brainmsg = "200,0,0,46185,38494,32585,7639,10915,18850,28676,8507";
char charBuf[50];
braindata.toCharArray(charBuf, 50)
char *Brainmsg= charBuf