Created
April 11, 2013 22:18
-
-
Save macklinu/5367668 to your computer and use it in GitHub Desktop.
use a barcode scanner to store a barcode as a string in Processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String barcode = ""; | |
| void setup() {} | |
| void draw() {} | |
| void keyPressed() { | |
| barcode+=key; | |
| if (key == '\n') { // we've reached the end of the barcode | |
| println(barcode); | |
| barcode = ""; // reset the barcode to receive a new one | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment