I am using the RS232 barcode scanner
https://www.lazada.com.my/products/embedded-1d-2d-barcode-scanner-reader-module-ccd-bar-code-scanner-engine-module-with-rs232-interface-i140694063-s161534741.html?spm=a2o4k.searchlist.list.1.32ca3369etb0YU&search=1
A RS232 to TTL converter
https://www.lazada.com.my/products/pcb-3v-5v-serial-port-rs232-to-ttl-converter-module-for-diy-project-i480836553-s802816738.html?spm=a2o4k.searchlist.list.1.2d196978bIm5tg&search=1
Arduino board using the Mega
Connect RS232 barcode scanner with Rs232 to TTL converter using a null RS232 modem
- CODE: SELECT_ALL_CODE
#include <SoftwareSerial.h>
SoftwareSerial mySerial(19, 18); // RX, TX
void setup() {
Serial.begin(9600);
}
void loop() {
if (mySerial.available()) {
int val = mySerial.read();
Serial.println(mySerial.read());
}
if (Serial.available()) {
int val1 = Serial.read();
mySerial.println(Serial.read());
}
}
RS232 to TTL converter's TxD and RxD are connected to arduino pin 18 and 19.
After the scanning TxD and Rxd not blinking at all.
Serial monitor also didnt have any outcome.
Thanks.