2.2 How to use : Use SDK - ZergEggTruwin/TW8035_Example_MFC GitHub Wiki
-
Place the TW8035_DLL.dll file and TW8035_DLL.lib in the same directory as the executable file.
-
Include TW8035_API_DEF.h. Functions are defined in this file.
-
To connect TW8035 call serialPortConnect Function like this :
serialPortConnect(this /* CWnd* */, portName /* “COM7”
-
Our API sends data in events. Write Window Proc function like this :
LRESULT CTW8035_MFCDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_COMM_RX_DATA)
{
TWImageData* twi = (TWImageData*)wParam;
unsigned short imageArr[4800] = {};
memcpy(imageArr, twi->ImageData, 9600);
}
return CDialog::DefWindowProc(message, wParam, lParam);
}