2.2 How to use : Use SDK - ZergEggTruwin/TW8035_Example_MFC GitHub Wiki

  1. Place the TW8035_DLL.dll file and TW8035_DLL.lib in the same directory as the executable file.

  2. Include TW8035_API_DEF.h. Functions are defined in this file.

  3. To connect TW8035 call serialPortConnect Function like this :

    serialPortConnect(this /* CWnd* */, portName /* “COM7”

  4. 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);
}
⚠️ **GitHub.com Fallback** ⚠️