for a project i need to display barcode reading in 16*2 display.
barcode is usb interface (plug and play , no need of drivers)
so i placed data+ to 9
data- to 8
when i scan barcode i get only a blink in display
any one help ????
[color=blue]#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
long USBINN = digitalRead(9);
void setup() {
// set up the LCD's number of columns and rows:
pinMode(USBINN, INPUT);
long(USBINN);
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(USBINN);
}
void loop() {
// scroll 13 positions (string length) to the left
// to move it offscreen left:
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(150);
}}[/color]
rajeetharan:
for a project i need to display barcode reading in 16*2 display.
barcode is usb interface (plug and play , no need of drivers)
so i placed data+ to 9
data- to 8
when i scan barcode i get only a blink in display
any one help ????
[... snip ...]
Unfortunately that "plug and play, no need of drivers" bit is only for computers. I imagine this means that when you plug the scanner into a computer it is recognized as a HID (Human Input Device) keyboard. And when you scan a barcode the scanner sends keyboard-style communication as if someone typed in the barcode numbers very quickly. USB is actually a very complicated protocol. You would either need a USB host shield (a quick google search shows at least 2 available) or an ArduinoDue. If you decide to go the Due route, check this page out to see how to use a keyboard-type interface: USBHost - Arduino Reference
you are correct on HID. Absolutely it is as u said.
so now i have to go through the two of you mentioned ?
rajeetharan:
you are correct on HID. Absolutely it is as u said.
so now i have to go through the two of you mentioned ?
One of the two. Either a USB Host shield or an ArduinoDue. I haven't used either, but I would imagine that the shields would come with a support library.
Sorry I can't help you much further than pointing you in the right direction.
You can connect as keyboard only a "keyboard emulator optical scanner" like this:
http://www.barcode.co.uk/products/datalogic-dll5010-m.htm
So you can connect like a keyboard (some resistor required, see this, card number 24)
http://forum.arduino.cc/index.php?topic=146152.0