Problem-communication between arduino mega and bar code reader module "gm65"

This is why we ask for this kind of detail... consider reply #9.

The schematic you posted uses a different serial port and mis-names the pins as well.

Please bring us up to date on any changes to your sketch. Is the Arduino going to do any processing of the bar code? If not, you could just connect the module to a USB-serial device and be done.

Yes, i changed the connections and the code according the diagram.
i need the codes to register things, so yes the arduino is going to do processing

Which diagram, and what was the result? :frowning:


according this diagram. it doesnt work yet :frowning:

Well, that is an incomplete and also incorrect diagram, so I'm not very surprised...

this is the new code

#include <SoftwareSerial.h>

SoftwareSerial mySerial(17, 16); // RX, TX

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  pinMode(17, INPUT);
  pinMode(16, OUTPUT);
  Serial.print("scanner initialized");
}

void loop() {
  // run over and over

    byte x = mySerial.read();
    Serial.println(x);
}

Okay, you just ignored some really good advice. So mine is worthless to you. Goodbye, I won't see any further of your posts.

Surely you are joking.

Good luck with your project.

nope..
with the pin movement, now your on hardware Serial2 trying to construct a SoftwareSerial..

code should now look like this..

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);

  Serial.print("scanner initialized");
}

void loop() {
  if (Serial2.available()) {
    byte x = Serial2.read();
    Serial.println(x);
  }
}

ref.. Serial

sorry.. ~q

thanks man, is now working. the other guy was not helping

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