<< return to Pixycam.com

Read Barcode on Arduino and Pixy2 at the same time

I’m using Arudino and Pixy2 to make a line tracking AGV for my project. I use barcodes to stop and load luggage. It may be falsely detected in a place where there is no barcode. So I’m programming to read two barcodes at the same time, but it doesn’t work.
The one-read code is

if (pixy.line.barcodes-> m_code == 1)

The code for simultaneous reading is

if (pixy.line.barcodes-> m_code == 1) && if (pixy.line.barcodes-> m_code == 5).

Reading at the same time does not work, is there a way? ??

Hi Toshiki,

unfortunately I don’t believe it’s possible to read multiple barcodes at the same time…I might be wrong about this though. @edge probably knows better than I do.

Thanks,
Jesse

Hello,
If you’re using getMainFeatures(), you will only get 1 barcode, and it will only be reported once so you don’t need to keep track of whether you’ve seen the same barcode before.

If you want to get multiple barcodes and not have each barcode reported once, you should use getAllFeatures()

This page explains in more detail:
https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_api

Hope this helps!

Edward