RX TX Communication

Hello,

I am trying to send sensor values collected with an Arduino Uno to another Arduino and then to the Computer. This second Arduino is necessary because of the build-up. So on the first I've got Serial.write() and on the second I've got Serial.write(Serial.read()). It works well, with the only issue that I get unreadable values in some weird notation.

Example: "HI" would be 727310.
Please help!!!

Thank you in advance

Julek:
Example: "HI" would be 727310.
Please help!!!

Let me make a guess:
You are sending "HI" from the serial monitor and the serial monitor is configured to send "Newline" at the end of a line?

'H' is ASCII-72
'I' is ASCII-73
LF (line feed) is ASCII-10

All together is:727310

So what?

Perhaps loop up a thing called "ASCII table" to find out the ASCII codes of printable characters and control characters.

Your problem is probably the code that finally prints out those values. This would reside on a computer somewhere? Running some code that has nothing to do with the arduino.

@Jurs:
Thank you very much for your fast reply. I used this website: http://arduino.cc/en/Tutorial/ASCIITable. To adjust the values at the second Arduino I wrote this code:

void setup(){
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
int v = Serial.read();
if(v>=48 && v<=57){
v = v - 48;
Serial.print(v);
}
else if(v==59){
Serial.print(";");
}
else if(v==64){
Serial.println();
}
else if(v==46){
Serial.print(".");
}
else if(v==45){
Serial.print("-");
}
}
}

It works perfectly.

Cheers!

Julek:
@Jurs:
Thank you very much for your fast reply. I used this website: http://arduino.cc/en/Tutorial/ASCIITable. To adjust the values at the second Arduino I wrote this code:

But perhaps you not really wanted to write code for numerical ASCII-code processing, but you wanted to process characters instead of numerical values and send them back using 'write' instead of 'print'?

void loop() 
{
  if (Serial.available() > 0) 
  {
    char c = Serial.read();
    Serial.write(c);
  }
}

In your first post you say you're using Serial.write then you post code that has Serial.print I suggest you do some research to understand the difference. This is where your problem lies.