This is an extension of the previous post C.07 QR Code Generation, with the same aim to replace the input (key presses) with QR code detection through the webcam.
To begin with, I opened vendtest (the processing sketch that set up communication with the arduino) and copied the code over to the QR sketch I had created previously.
I edited the if statements copied over from keyPressed to use the decoded message in the condition. They didn’t work initially, and after some time scratching my head, it dawned on me that I may have made a similar mistake to the one I made last week (using = instead of ==). A quick search on processing.org reveals that when comparing two strings, the function equals() should be used.
I replaced it as shown, almost forgetting to put my strings in inverted commas.