Hi All,
I've search this forum and google for a few days already and was able to get a small start on this project. I originally wanted to use a linear barcode, but I realized that QR is super popular and so 2D is the way to go. So I got one of these uber scanners online: http://www.barcodesinc.com/code/cr8000.htm. I'm using this scanner because it outputs RS232 TTL (5V) and not RS232 (12V), and this is perfect for the uart on the arduino. Also, it can scan both linear and 2D and has a dedicated decoder (less work for me). I got the darn thing to scan some information. However the output is gibberish, but consistent gibberish (good). By consistent, I mean to say that when I scan 123456 from either a linear barcode or a 2D barcode, the output is the same. The scanner is currently configured to use 8 Data Bits, no parity, 1 stop bit.
So far:
I have Clear To Send (CTS) pulled to high all the time on the scanner. When Request To Send (RTS) is sent from scanner, arduino would send out a flag (digitalWrite(x, HIGH)) to tell the scanner to go ahead a send the package.
If someone could help me get the true output, that would be great.
#define CTS 9
#define RTS 8
#define PUSH 10
boolean REQUEST, BUTTON;
int barcode;
void setup()
{
Serial.begin(115200);
Serial.flush();
pinMode(CTS, OUTPUT);
pinMode(RTS, INPUT);
pinMode(PUSH, INPUT);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
Serial.println("TEST");
}
void loop()
{
REQUEST = digitalRead(RTS);
BUTTON = digitalRead(PUSH);
if(BUTTON == HIGH)
{
delay(250);
Serial.println("BUTTON IS PRESSED"); //make sure something still works
}
if(REQUEST == HIGH)
digitalWrite(CTS, HIGH);
if(Serial.available() > 0)
{
barcode = Serial.read();
Serial.println(barcode, DEC);
}
}
Example. When I scan 123456, the serial monitor outputs:
g (should be 1)
3
æ
¹
r (should be 6)
I hope others can help me on it. Once finished, I'll post all hardware/software regarding this small project (similar to the 2.8" TFT Touchscreen).


