Arduino looking up data from 'database'

Hi,

I need to know whether it is possible to have an arduino look up something stored in a variable associated with another variable. For instance if it scans a barcode, could it then check to find the best before date associated with that item. I am trying to use this in a conveyor belt sorting system for an examined project so I would like to know if I could do it before I try.

Thanks

I need to know whether it is possible to have an arduino look up something stored in a variable associated with another variable.

Rather a vague statement, but the answer is probably yes.

For instance if it scans a barcode, could it then check to find the best before date associated with that item.

If you keep two lists (typically arrays), containing barcodes and "best before dates", then the index of the scanned barcode in the barcode list can be determined, and used to access the correspond item in the other list.

I am trying to use this in a conveyor belt sorting system for an examined project so I would like to know if I could do it before I try.

I presume that you'd compare the best before date to the current date, then, to determine where to route the scanned item. Certainly seems feasible.

Thanks.

omarhussein:
Hi,

I need to know whether it is possible to have an arduino look up something stored in a variable associated with another variable. For instance if it scans a barcode, could it then check to find the best before date associated with that item. I am trying to use this in a conveyor belt sorting system for an examined project so I would like to know if I could do it before I try.

Thanks

You can do it, it is just a small matter of programming (yeah, I know, small matter of programming can devolve into months long dead ends and detours).

However, bear in mind that the Arduino doesn't have that much memory, so it will limit how many items you can keep track of. If you only have 10-20 items, it is probably doable, if you have hundreds, it probably would require some careful programming and sizing, and if you have thousands, then you are probably best storing it on a PC, and having the Arduino just passing the barcode to the PC for further processing.

Thanks for that Michael. I don't think I'm going to be going beyond 25ish.