Hi,
I'm new to arduino and trying to make this tutorial to work
I'm using a different chip – max232N – so I have different chip leg number from the one in the tutorial, but I followed the correct ones.
In the rs-232 connector I connect 4 to 6 and 7 to 8 – so the RTS and CTS will work.
But it doesn't work well.
I have connection from the arduino to the computer but instead of getting back the same letters in capital – I get gibberish – all kind of letter in Greek (alpa, bita ? ) , and I also don't get the "hi" in the beginning .
Never mind about this.
I used the tutorial just to see that my RS-232 connections are ok.
So I ended up checking it with software serial instead of all the code in the tutorial.
And it worked!!
I'm adding the code in case it will help someone
// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define ledPin 13
// set up a new serial port
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.print("Hii");
delay(10);
Serial.begin(9600);
Serial.print("HI");
}
void loop() {
// listen for new serial coming in:
char someChar1 = mySerial.read();
mySerial.print(someChar1); // send back to the computer using the RS-232
Serial.print("recive : ");
Serial.println(someChar1,HEX); // print also in serial monitor
}