I want to interface my barcode scanner with an Arduino using RS232. I have connected 2 (RX), 3 (TX) and 5 (GND) of the RS232 with the corresponding pins of MAX232. I am taking TTL outputs on Arduino pins 6 and 7.
This is the code of the Arduino program:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // RX, TX
void setup() {
Serial.begin(9600);
}
void loop() {
// run over and over
if (mySerial.available()) {
byte x = mySerial.read();
Serial.println(x);
}
}
I am not getting any output on the serial monitor when I scan a product.