SUB-20 Python support under Linux and Mac OS

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

SUB-20 Python support under Linux and Mac OS

Post by serg »

The SUB-20 can be accessed in a Python script executed under Linux or Mac OS X. To achieve this, makefile which is used to build the libsub.a static library should be modified for building a shared object instead, see below

#-------------
# Linker Flags
#-------------
LDFLAGS += -L/usr/local/lib -lusb-1.0

libsub.so: libsub.o
$(CC) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@

The resulting libsub.so shared object can be loaded and used in a Python script under Linux or Mac OS X

Post Reply