Serial monitor question

Hi everyone!

Why is it, that when i send a value from my Arduino Mega to my Arduino Uno r3 via rx/tx that the value changes?

For example, if i read an 8 on the Arduino Megas serial monitor, that value is turned into 160 when i read it on the Unos serial monitor?

Using the following code:

Arduino Mega

// Potmeter arduino 

int potPin = A0;

void setup() 
{
  Serial.begin(9600);
}

void loop()
{
 
  int val = map(analogRead(potPin), 0, 1023, 0 , 9);
  Serial.print(val);
  delay(500);
  
}

Arduino Uno r3

//Servo arduino

#include <Servo.h>

int servoPin = 9;

Servo jeremysServo;

void setup () 
{
  Serial.begin(9600);
  
  jeremysServo.attach(servoPin);
}
void loop()
{
  while(Serial.available() == 0);
  
  int data = Serial.read() - '0';
  
  int pos = map(data, 0, 9, 0, 180);
  pos = constrain(pos, 0, 180);
  
  //Turn servo
  
  jeremysServo.write(pos);
  Serial.print(pos);
  
  Serial.flush();
}

For example, if i read an 8 on the Arduino Megas serial monitor, that value is turned into 160 when i read it on the Unos serial monitor?

It appears that the conversion is what is written in the code. Do you follow the mapping functions? What do you expect?