Exemple #1
0
# Script to test barcode reader functionality with whitelist
# Set variable duration for length of test
# Add barcodes to 'barcodes' list for accepted barcodes
# All barcodes not in list are rejected
# Green light blinks 3 times for accept, red light blinks 3 time for reject

import time
import barcode

duration = 30  # Duration of script in seconds

barcodes = ['1234567890', '987654321098']  # List of accepted barcodes


# initialize barcode reader
bar = barcode.barcode()


startTime = time.time()
print "Barcode test started, waiting for scan..."

i = [1, 2, 3]
while( time.time() - startTime < duration):

    # Check barcode reader
    data = bar.check()
    if (data in barcodes):  # Put accepted barcodes here
        print data, " : barcode ACCEPTED"

    elif (data != ''):  # Barcode not in accepted list
        print data, " : barcode DENIED"
Exemple #2
0
import time
import vehSensor
import barcode
import light
import serverAPI
import datetime
import LPR

duration = 60
heartbeat = 60


# initialize barcode reader, vehSensor, lights
barcode = barcode.barcode('/dev/ttyACM0')
#barcode = barcode.barcode('/dev/tty.usbmodemfa141')
vehSensor = vehSensor.vehSensor()
#LPR = LPR.LPR()
ledGreen = light.light(32)
ledRed = light.light(33)
server = serverAPI.serverAPI('lot-manager','test123','Marina Middle School')


startTime = time.time()
heartbeatTime = time.time()
qrReg = []
checkedIn = []
checkedOut = []
print "Parq Place demo started..."


Exemple #3
0
import barcode

print(barcode.barcode())