///////////////////////////////////////////////////
// BitsyXGPIOTest.cpp
// 720020-1180x
//
// Applied Data Systems
//
// This test application is part of the BitsyXGPIO
// class
///////////////////////////////////////////////////
#include <windows.h>
#include "BitsyXGPIO.h"

int WINAPI WinMain(	HINSTANCE hInstance,
				   HINSTANCE hPrevInstance,
				   LPTSTR    lpCmdLine,
				   int       nCmdShow)
{
	int i;
	
	RETAILMSG(TRUE, (_T("+BitsyXGPIOTest\r\n")));

	// create as both output (default)
	BitsyXGPIO *gp = new BitsyXGPIO();

	for(i = 0 ; i < 300 ; i++)
	{
		gp->Write( 1 );
		Sleep(500);
	}

	// change to input
/*	gp->SetDirection(0);

	RETAILMSG(TRUE, (_T("\r\n")));
	for(i = 0 ; i < 600 ; i++)
	{
		RETAILMSG(TRUE, (_T("Read value: 0x%02x\r"), gp->Read()));
		Sleep(10);
	}

	// do a series of reads
*/
	delete gp;

	RETAILMSG(TRUE, (_T("\r\n-BitsyXGPIOTest\r\n")));

	return 0;
}