Date: Wed, 10 Aug 2016 16:27:52 -0700
From: Bret Victor
Subject: Re: barcode scanner
Closing the loop on the barcode boop.

I set up a sad little kiosk:


and when you boop a barcode, the webpage comes up on the kiosk:


Next step is multiple screens (iPads or monitors) with their own barcodes, so you can redirect your boops to the screen of your choosing.


---

Implementation notes:

A shell script:

./picocom --baud 9600 --imap crlf /dev/tty.usbserial-* | perl open-barcodes.pl

uses picocom to listen to the USB serial port connected to the XBee, and pipe it into a perl script:

while (<>) {
    chomp;
    if (/^\d{8}$/) {
        system("./chrome-cli", "open", "http://barcode.dynamic.land/goto?barcode=$_", "-t", "2");
    }
}

which looks for eight-digit numbers, and uses chrome-cli to open the barcode redirect URL in a Chrome tab.