advice on sending data to another board

I have two nano boards and want to send a number from one board using the keypad, to another board which will then display the number on a seven segment display.

I have written the code but I seem to have two problems

#1 I dont know how to wire the set up so that the second board can read the values correctly? can i use any pin or are there set serial pins to use for Serial.available() and Serial.read()?

#2 is there a better way to turn a char to an int? other than just setting each umber char as an interger in seperate lines of code? thanks for the help.

This is my code.

void loop() {

/////////////////////////////////////seven segment/////////////////////////////////////////////////////////
{ if (Serial.available()) //sends to other board
{
byteRead = Serial.read(); //reads value
reply = 1;
for (int ia = 1; ia<=9; ia++)
{
digitalWrite(pinArray[ia-1], SevenSegmentMap[byteRead][ia-1]);
}
Serial.write(reply);
}
else
{
reply = 0;
Serial.write(reply);
}
}

//////////////////////////////////////keypad//////////////////////////////////////////////////

{
char key =kpd.getKey();
if (key != NO_KEY)
{
Serial.println(key);
if(key == '0')
{
number = 0;
}
else if(key == '1')
{
number = 1;
}
else if(key == '2')
{
number = 2;
}
else if(key == '3')
{
number = 3;
}
else if(key == '4')
{
number = 4;
}
else if(key == '5')
{
number = 5;
}
else if(key == '6')
{
number = 6;
}
else if(key == '7')
{
number = 7;
}
else if(key == '8')
{
number = 8;
}
else if(key == '9')
{
number = 9;
}
for (int ib = 1; ib<=9; ib++)
{
digitalWrite(pinArray[ib-1], SevenSegmentMap[number][ib-1]);
if (Serial.available())
{
Serial.write(number);
Serial.println(number);
}
}
if(Serial.available())
{
byteRead = Serial.read();
if (byteRead != 0)
{
digitalWrite(ledpin, HIGH);
}
}
delay(1000);
digitalWrite(ledpin, LOW);
}
}
}

Please read the "how to use the forum" stickies to see how to properly format and post code.
This post might help with your serial communication questions. If you want to use the serial monitor to debug code you will need to use software serial ports for the 2 arduinos to talk.

Please modify your post and use the code button </>

so your code looks like this

and is easy to copy to a text editor. See How to use the Forum

You should use SoftwareSerial to create an extra serial port on each of your Unos as that will leave pins 0 and 1 free for uploading programs and debug messages to the Serial Monitor.

However I'm wondering why you are using two Arduinos - can't you do everything on one?

...R
Serial Input Basics