Arduino: Barcode Scanner (Work In Progress)

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)

// 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);
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.