passing information in arrays from another board to another,.

for examples sake lets use the below array

array(
Name => 'Bobby',
Date => 'Today',
Birth => 'Now'
);

i want another board to take this information and send it to another board.

so uno to the mega 2560

lets use the below array/quote]Is that really an array ?
In any case the answer is the same. You can send each byte of the array over a serial link and reconstruct it at the receiving end.

It would be easier to help if you posted the code of the program that holds the data to be transferred.

for examples sake lets use the below array

Let's not. The Arduino is NOT programmed in PHP.

do you know how to structure it for arduino. i did php example because i tried doing arduino style but couldnt get it to work right. can you post an alternate method of sending data.

and for receiving data i just want to make sure the data is still readable on the other side. so what i send ill receive and be able to pull it up without any issue.

do you know how to structure it for arduino.

int array[] = { 1, 2, 3 };
char *anotherArray[] = { "IQ", "salary", "age" }

i want another board to take this information and send it to another board.

so uno to the mega 2560

So, one board with the data passes it to another board that passes it to a third board?

HOW do you intend to pass the data? Something must logically or physically connect the boards. Only when you have defined HOW the data will get from one device to the other, we can help you with the code to make that happen.

no just to one board to another.

the means would have to be fairly simply im a complete nub on this.

so lets say.

the mega is gonna act like the brain of the operations.

the uno is just a small add on. i want the uno to send like...info by an array. then have the mega recognize that array as data then stores it in a variable.

I hope i make sense.

i want the uno to send like…info by an array. then have the mega recognize that array as data then stores it in a variable.

That is not possible. The data in the array can be sent. But HOW are the Arduinos going to be connected? Are you planning to duct tape them together? Are you planning to use XBees and appropriate shields? Are you planning to run wires between the two Arduinos?

Why do you need two Arduinos?

well if possible by wires.

i never heard of xbee until now.

im working on a personal project. and i want something to be recognized when its plugged into the brain cpu. so an uno will take care of processing the info then sending it back to the main computer the mega for storage and further processing.

eg.

UNO needs to send data.

int pinarray = {1,2,3,4,5};
char setarray = {"Home","Bath","Floor","Sink","Door"}

now we have the mega to receive the above array from the uno. now the mega can do anything it wants. also...there is a particular reason i want it being sent this way.

Grieva:
there is a particular reason i want it being sent this way.

Since your Arduino doesn't understand english, you will need to send the data in any way it does understand.

It understands methods like Nick Gammon's State Machine prototype, which is ideal for passing multiple pieces of data back and forth from one Arduino to another...

Read through his example; it may be helpful.

thanks for the post builddog but its not quite what i was looking for.

im looking for a way that the arduino can uniquely identify themselves while being plugged into the mega. so the mega can manage several unos. but uno will have a id.

so its something like uno.config is what im looking for.

DeviceName="Garage Uno"
PinConfig="5"

something like this but pass this info from the uno to the mega.

i hope this helps.

im looking for a way that the arduino can uniquely identify themselves while being plugged into the mega. so the mega can manage several unos. but uno will have a id.

So you want them connected physically? Look up examples of how the mega can communicate with the yun shield so it can run Linux. that's pretty much the same thing you are wanting to do, though it doesn't make any sense at all why you would want to run multiple unos off a mega.

so here I am I'm Arduino #10:

void setup()
{
  Serial.write('I')
  Serial.write(0xA);
}

Use the Nick Gammon state machine example... you could send an 'I' (Sending Identity) and 0xA (I'm number 10).

Host sees Arduino #10 connected!

after reviewing the post i thought about the state machine also. i didnt properly read your post. quick question. how can you detect if a wire is bad or like something of a pin check in. just to let you know the pin is receiving data. do i simply just do != 0?

Of course, you can use Serial.print() or Serial.println() to send longer names:
Serial.println("Name: AtticAboveUpstairsClosetBackRoom");
Serial.println("ID: 3asf7222772s7723277xsa");

(Though simple is better...)

how can you detect if a wire is bad

You can't. If you have properly included pullup or pulldown resistors, the pin will read HIGH or LOW (whatever unpressed means) when there is a wire properly connected and sending no data AND when there is no wire connected.

The only way to know that a wire is good is to send some data to the device on the other end AND get the expected response.

alright so i changed the code around for my stuff.

msgsender.ino

void setup() {
  Serial.begin(115200);
  Serial.println('[N]Uno');
  Serial.println('[T]Board');
}

void loop() {
  // put your main code here, to run repeatedly:

}

msgreceiver.ino

typedef enum{NONE,GOT_N,GOT_T} states;
states state = NONE;
unsigned int currentValue;

void setup(){
  Serial.begin(115200);
}
void processName(const unsigned int value){
  Serial.print("Name = ");
  Serial.println(value);
}
void processType(const unsigned int value){
  Serial.print("Type = ");
  Serial.println(value);
}
void handlePreviousState(){
  switch (state){
    case GOT_N:
      processName(currentValue);
    break;
    case GOT_T:
      processType(currentValue);
    break;
  }
  currentValue = 0; 
}
void processIncomingByte(const byte c){
  if(isdigit(c)){
    currentValue *= 10;
    currentValue += c - '0';
  }else{
    handlePreviousState();
    switch(c){
      case '[N]':
        state = GOT_N;
      break;
      case '[T]':
        state = GOT_T;
      break;
      default:
        state = NONE;
      break;
    }
  }
}
void loop(){
  while(Serial.available())
    processIncomingByte (Serial.read());
}

when i pull up the serial monitor on 115200 baud both give me the same readings.

28271
29284

im trying to figure out where its going wrong.

ideally i want it to spit out the name=name and type=type

Serial.println('[N]Uno');

This isn't python. Single quotes are for single characters. For strings you need double quotes.

Serial.println("[N]Uno");
switch(c){
      case '[N]':

Again. [N] is NOT a single character. To get all that is going to require three sequential Serial reads.

And you can do switch case with single characters, but not with strings.

what would be a good replacement? i tried a few ways but still couldnt figure it out.

what would be a good replacement?

See Dr. Frankenstien for a new brain.

i tried a few ways but still couldnt figure it out.

Post something!