Bar Code and Arduino

Hi !

For a project i 'm building a system with 21 boxes and a robotic arm who can dispatch a certain ammount of little rocks inside each one of them. I already did this part and this is working great but my problem is to communicate with the arduino:

Right now to tell him i want (for exemple) 2 rocks in the box 4, 3 rocks in the box 5, and 1 rocks in the box 6, what I do is just rewrite my code on the comptuer and then upload again in the arduino.

What i want to do is send 21 differents numbers to my arduino so he know exactly how many rocks to put in each box. For that i wanted to use a code bar system but i sure dont know how to do it so i ask for your help and advise :). If you have a better idea than code barre to send this information to the arduino i take it too!

Thank you very much and please excuse my english, i'm a non native speaker...

Happy new year

Nico