Arduino connecting to barcode scanner

I connected my barcode scanner to my arduino UNO Rev 3, it works and my scanner does scan barcodes but i just can't manage to get any output in my program:


We got exectly this but we changed the Nano board for a UNO. Can someone help me find a good code? Or can someone explain how to rewire it the right way to the UNO board?
The LCD is a problem for later but for now we really need a output.
Thanks everyone!

(this is the code we used earlier)

#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4); // RX, TX
 
void setup()
{
  Serial.begin(9600);  
  mySerial.begin(9600); // set the data rate for the SoftwareSerial port
}
 
void loop()
{
  if (mySerial.available()) // Check if there is Incoming Data in the Serial Buffer.
  {
    while (mySerial.available()) // Keep reading Byte by Byte from the Buffer till the Buffer is empty
    {
      char input = mySerial.read(); // Read 1 Byte of data and store it in a character variable
      Serial.print(input); // Print the Byte
      delay(5); // A small delay
    }
    Serial.println();
  }
}

Try draw schematics showing the pin labels. Fritzing is not readable.

What type of barcode scanner are you using?
Are you certain the barcode scanner is operating at 9600 baud?

Link to your scanner, please. I suspect your scanner is providing true RS232 signal levels, which is a hazard for your Arduino.

https://a.aliexpress.com/_mPeDDOu
I know its not the best but we're testing it out, it has a USB and a rs232 connection

https://a.aliexpress.com/_mPeDDOu
I'm not sure, just to be clear i'm a absolute rookie. We need to do this for our school machine but we really wished not using a arduino😅

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.