K8055 programming for a game

Hi, i have recently purchased a K8055 usb experiment board, and ive had a play around with the code in visual studio (visual basic to be precise lol) and ive come up to a problem. I have thought about adding some code to an open-source dancing game, so i can use its disco-lights features on this card, driving some superbright LEDS that would flash in time to the beat. problem is its written in C++, not basic. Ive managed to work out the structure of the lights code in the game, but i havent a clue as to what code i need to use for the card. at present im using Visual Studio express editions so i have no way to integrate visual basic code with visual c++, so my question is this:

What code would i need to use to initialise the card, and send the digital output data to it (the WriteAllDigital one) and is it possible to just include the code for these bits? as the game doesnt have any use for the other features on the card.

Thanks in advance

Sounds like fun :slight_smile:

Have downloaded the K8055 example for C++ yet?
velleman.be/downloads/files/ … vc2005.zip

What you basically need to do is import the functions available in the K8055D_C.DLL. You’ll need the .lib and the .dll to achieve this.

#ifdef __cplusplus
extern "C" {
#endif

#pragma(lib, "K8055_C.lib");

__declspec(dllimport) long __stdcall OpenDevice(long CardAddress);
__declspec(dllimport) void __stdcall WriteAllDigital(long Data);

#ifdef __cplusplus
}
#endif

Thanks for the help :slight_smile: i shall have a look throught the example and give it a try :slight_smile: