// Copyright 2005 Doi Shigeki // list0602.cpp 簡単なFT232B、ビットバングモード動作の例 // 動作速度チェック // ftd2xx.libをリンクすること #include #include #include #include"ftd2xx.h" main() { FT_HANDLE hft; BYTE x; DWORD n; int i; printf("FT232BM ビットバングモードのテスト2\n"); if( FT_OK != FT_Open( 0, &hft)) { printf("open error\n"); return 0; } FT_SetBaudRate( hft, 9600 ); // 転送レートの設定 FT_SetBitMode( hft, 0x55,1); // 入力4ビット,出力4ビット printf("点滅動作,xボタンで強制終了\n"); x = 0; while( 1 ){ FT_Write( hft, &x, 1, &n ); x++; } FT_Close( hft ); }