Pages: [1]   Go Down
Author Topic: Barcode reader  (Read 667 times)
0 Members and 1 Guest are viewing this topic.
Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,

My project is where I need to interface a bar code reader with a mega2560. I have the option to use either a
PS2 or a USB device. My question is, can I use the Keyboard Library to read data from the scanner ?. Is yes, then what is the method to store this value in a variable, since I'll be checking it against a set value.
One more question is, if I use a USB based scanner, then I know I'd have to use a USB Host Shield, but will I have to make too many changes to the earlier program to adapt to the USB addition ?

The keyboard program I'm referring to is :
  http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html 
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Which barcode scanner are you using?

Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure yet...a motorola one, with an rs232 o/p
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49456
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
My question is, can I use the Keyboard Library to read data from the scanner ?
Probably not. The only Keyboard library I know of makes the Leonardo act like a keyboard. A keyboard is an output device, not an input device.
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are also those firmware update for the usb on uno but regardless that's only going to be helpful if the scanner can emulate keyboard input surely?
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I've decided I'll be using the Ethernet shield to connect to the scanner. My friend said that the Ethernet o/p on the scanner fires packets of data at an IP. Is it okay to switch to ethernet ?, also remember that the scanner can ship an RS232 option too. PS/2 is outdated.

Which do you think is easier, serial or Ethernet ?
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which do you think is easier, serial or Ethernet ?
I think it's a coin toss between them.  Ethernet could be more complex if you were starting with bare tin, but with the well documented libraries and examples available for Arduino networking support I think that evens it out quite a bit.  Once you get the hang of that, ethernet is a solid standard whereas there can be some timing tricks to serial.

I think you could make a strong case either way.

Good luck with your project !
Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Bangalore,India
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh thanks,  I may go for the Ethernet.
Logged

Pages: [1]   Go Up
Jump to: