Arduino: Barcode Scanner (Work In Progress)

Ok, here I have a Symbol LT-1780 handheld barcode scanner. It has an RJ-45 cable with a 9-pin end (Not RS-232). I took an old RS-232 plug and put that on the end of the cable, and used that to wire it up to the Arduino.

Pics Soon.

Pins (from Female Serial side):
Ground (7)
+5V (9)
Barcode (2)

Quote:
// Input
int barCode = 7; // Digitized Bar Pattern, connected to digital pin 7

int duration1 = 0;
int duration2 = 0;

void setup()
{
pinMode(barCode, INPUT);
Serial.begin(9600); // ...set up the serial ouput on 0004 style
}

// Main program
void loop()
{
duration1 = pulseIn(barCode, HIGH);
duration2 = pulseIn(barCode, LOW);

Serial.print(duration1);
Serial.print(" ");
Serial.println(duration2);
}

Trackback URL for this post:

http://erroraccessdenied.com/trackback/614

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <b> <i> <u> <cite> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <br> <p> <img>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Textual smileys will be replaced with graphical ones.
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.

More information about formatting options