Hi
I have a 2 arduino's and trying to make a serial command between them.
The first one is sending a serial string to the other
void setup()
{
Serial.begin(9600);
}
void loop()
{
int value1 = 10; // some hardcoded values to send
int value2 = 100;
int value3 = 1000;
Serial.print('
Plan is for when i get it to work, is to send a analog command to the other one. Just wanæt to get it to work before i move on
The serial output for now is
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
How can I decode it?
I have tried with examples with strtok() function. but I have had no luck
This is my first time trying the arduino, so just a total noob question
Could someone help me in the right direction?
); // unique header to identify start of message
Serial.print(",");
Serial.print(value1,DEC);
Serial.print(",");
Serial.print(value2,DEC);
Serial.print(",");
Serial.print(value3,DEC);
Serial.print(","); // note that a comma is sent after the last field
Serial.println(); // send a cr/lf
delay(100);
}
Plan is for when i get it to work, is to send a analog command to the other one. Just wanæt to get it to work before i move on
The serial output for now is
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
$,10,100,1000
How can I decode it?
I have tried with examples with strtok() function. but I have had no luck
This is my first time trying the arduino, so just a total noob question
Could someone help me in the right direction?