Barcode Reader with YUN

ERIKMONHUI:
Where do you declare String [eventID] ??

You don't.

Are you referring to this bit of code?

ShapeShifter:
An instance of a Process object named EventProcess is declared globally, and this code in setup() starts the process:

   EventProcess.begin("/mnt/sda1/barcode.py");

EventProcess.addParameter(String(EventID));
  EventProcess.runAsynchronously();

Note that this usage of String is followed by round parenthesis, not the square brackets you used in your post. Square brackets are used to access or define an array, String here is not an array, it is a type name.

With parenthesis, the construct String([i]<something>[/i]) is calling the String type constructor to convert the argument into a string (a sequence of characters.) In this case, EventID is an integer, and String(EventID) is converting that integer to a string to match the expected data type for arguments to addParameter().

EventID is either an integer type variable or constant defined somewhere in your code. Or, you could replace EventID with a literal constant such as 0. Of course, if you are going to hard code a value like that, it makes more sense to just start with a string in the first case, rather then using a conversion: instead of EventProcess.addParameter(String(0))l it would be more efficient to just use EventProcess.addParameter("0");

This is passed as a parameter to the Python script described above, and is used to specify which device the script should be processing. For example, if EventID has the value 1, the Python script will be reading from /dev/input/event1/