usb host shield and barcode

so i have bought USBhost shield,mega 2560 and MH-ET LIVE Scanner V3

i using HID input and using the example
USBHIDBootKBD code from the library of usb host shield library2.0

the output is bunch of alien word…
does anyone have simple code for barcode, so i can further studying on it

:frowning: :frowning:

i need simple code for usb host and barcode,for serial monitor to show my output
i have try search around, non of them work
:cry: :cry:

barcode scanner :mh-et live scanner v3

after i run USBHID_desc
my serial monitor Received alien code...


so i try some keyboard sample code
and i have alien message again from my serial monitor,
so i believe there is some problem between my mega 2560 and usb host shield

at the end i tried with keyboard it’s working because of my serial monitor have to set the same boundrate…

can anyone please provide me a simple code of usb host barcode scanner,for serial monitor
using HID

That scanner is configurable and has some jumpers. As a simple test, can you first get it working by connecting it directly to your PC and get some output from it in text editor (notepad etc.) ?

If you get strange output on the Arduino serial console each time you scan something, then the problem is likely to be a baud rate mismatch. Try 9600.

Post a screen shot of the serial console after the scanner has written something to it.

i able to write on notepad,i did follow the setup

next i will need a barcode usb example, for my arduino.

i checked the sample of the library i find keyboard mouse..etc
i can't find a barcode 1

can you please provide me an example ?

i am using this library

this 1 is simple but
i have error >.<

Based on this issue with the library you are using, and the picture of the scanner which appears to show CH340G usb chips, it seems it may not work:

However, you may be able to connect a serial port of your mega directly to the tx and rx outputs of the scanner usb micro socket marked uart . Tx —> Rx, Rx—> Tx, grounds connected together. That is, without the host shield. You may have to hack a usb cable and/or do some soldering.
Read the chosen Serial port at 9600 with an Arduino sketch.


for this moment,i have sample of keyboard ,it’s working

now i try using MH-ET LIVE Scanner V3,
and looking for example barcode

you mean soldering ?please refer to my photo

Can you find an on-line schematic for that device ?

Instead of soldering, you may be able to remove the two jumpers on the scanner and connect a cable between the pin marked S-RX to the TX of one of your mega's serial ports and also the pin marked S-TX to the RX of the same mega serial port.
You need also a common ground connection between the mega and the scanner.
Write a sketch to read the chosen mega serial port and write the data read (at 9600baud) to the serial console.

alright i will have to try and find on-line schematic
get back in 1day

hmm, it seem like i not able to find a on-line schematic for MH-ET LIVE Scanner V3

should i buy a new device? btw i am from malaysia
i mean a simplest device straight connect to my mega

btw look at those vdd scl sda rst gnd

hmmm is it possible connect those to my arduino?

Sometimes it is easier to buy a ready made solution if such a thing is available.

But you can also try what I suggested in post #13. That needs only 3 connections between the scanner and the mega. You’ll need to write a small program (5 or 6 lines of code) to read the scanner input and print it.

Without a schematic or better documentation, it is difficult to be sure about how to use the interfaces.

please refer the documents here

to your post #13

i able to find S RX,S TX
from behind of the devide
you can see the image from post #12

and i also able to find the front as well, allow me to show the photo
maybe after.