Go Down

Topic: Arduino looking up data from 'database' (Read 1 time) previous topic - next topic

monkeymagic34

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

PaulS

Quote
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.

Quote
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.

Quote
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.


MichaelMeissner


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.

monkeymagic34

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

Go Up