// Usare l'integrato FT2232H - Versione 0.2 - Dicembre 2009 // Copyright (c) 2009, VincenzoV.net // Creative Commons | Attribuzione-Condividi allo stesso modo 3.0 Unported. // Creative Commons | Attribution-Share Alike 3.0 Unported // https://www.vincenzov.net/tutorial/elettronica-di-base/FT2232H/index.htm #include "stdafx.h" #include #include "ftd2xx.h" // Change according your system setting int _tmain(int argc, _TCHAR* argv[]) {FT_HANDLE ftHandle;  UCHAR Mask = 0xff; // All pins ad output  UCHAR Mode = 0x01; // Setting mode: Asynchronous Bit Bang  DWORD BytesWritten;  UCHAR TxBuffer[1];  FT_STATUS ftStatus; // Error code (=FT_OK if no error)  ftStatus = FT_Open(0, &ftHandle); // Open FT2232H and assign to "handle"  if(ftStatus != FT_OK) // Error?  {printf("Error code: %d \n", ftStatus); return(1); }  ftStatus = FT_SetBitMode(ftHandle, Mask, Mode); // Setup mode  if(ftStatus != FT_OK)  {printf("FT_SetBitMode failed! Code: %d\n", ftStatus); return(2);  }  for (;;) // Infinite loop  {TxBuffer[0]=0x40; // 0100 0000 - LED1 ON (connected to ADBUS6) ftStatus = FT_Write(ftHandle, TxBuffer, 1, &BytesWritten); if(ftStatus != FT_OK) {printf("FT_Write failed! Code: %d\n", ftStatus); return(3); } Sleep(1000); TxBuffer[0]=0x20; ///0010 0000 - LED2 ON (connected to ADBUS5) - LED1 OFF ftStatus = FT_Write(ftHandle, TxBuffer, 1, &BytesWritten); if(ftStatus != FT_OK) {printf("FT_Write failed! Code: %d\n", ftStatus); return(3); }  Sleep(1000);  } }