####################################
# Stamp.com 5lb Scale USB interface
# Author: rfesler@o-l-m.com
# Language: Python v3.2
# Externals: pyUSB v1.0
# Version:
# 0.2 -
# 0.1 - Rough Code (25Sept11)
####################################
import usb.core
import usb.util
import sys
# find the sclae
dev = usb.core.find(idVendor=0x1446, idProduct=0x6A73)
# was it found?
if dev is None:
raise ValueError('Device not found')
# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()
# Get data from USB Pipe 0x81
ret = dev.read(0x81,6)
# Byte 0 = Report ID (3 is the standard for scale data input reports)
# Byte 1 = Scale Status
# 1 = Fault
# 2 = Stable at Zero
# 3 = In Motion
# 4 = Stable
# 5 = Under Zero
# 6 = Over Weight
# 7 = Requires Calibration
# 8 = Requires Re-zeroing
# Byte 2 = Weight Unit
# 11 = ounces
# 12 = pounds
# Byte 3 = Data Scaling (This is the exponent that you raise 10 by to get the decimal)
# Byte 4 = Weight LSB
# Byte 5 = Weight MSB
print (ret)