K8055 qb64

How can I open and use the USB interface K8055 with the QB64 language? Which is the right code?

Here’s a simple demo how to open and use the K8055 or K8055N.

[code]DIM h AS LONG

DECLARE DYNAMIC LIBRARY “k8055d”
FUNCTION OpenDevice& (BYVAL CardAddress AS LONG)
SUB CloseDevice
SUB SetAllDigital
SUB ClearAllDigital
END DECLARE

PRINT “Press any key to open device”
WHILE INKEY$ = “”
WEND

h = OpenDevice(0)
PRINT h
IF h = 0 THEN
PRINT “Card 0 opened”
ELSE
PRINT “Card 0 not found”
END IF

PRINT “Press any key to set all digital”
WHILE INKEY$ = “”
WEND

SetAllDigital

PRINT “Press any key to clear all digital and close device”
WHILE INKEY$ = “”
WEND

ClearAllDigital

CloseDevice

END[/code]

The K8055D.DLL must be located inside the same folder as your QB64 application.

Thanks a lot for support. KR RWD