Skip to content

Instantly share code, notes, and snippets.

@macklinu
Created April 11, 2013 22:18
Show Gist options
  • Select an option

  • Save macklinu/5367668 to your computer and use it in GitHub Desktop.

Select an option

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