我很菜哈。
这是我的源码:
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "comtreadtest.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "YbCommDevice"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
try
{
YbCommDevice1->Active = true;
}
catch(Exception &e)
{
ShowMessage("YbCommDevice1: "+e.Message);
if(!YbCommDevice1->SettingsDialog(this,true))
Application->Terminate();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
YbCommDevice1->SettingsDialog(this,true);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
char a[5];
YbCommDevice1->Read(a,5);
for(char b=0;b<=4;b++)
{
Edit1->Text=a[b];
}
}
//---------------------------------------------------------------------------
我把我的单片机接在了串口上。用检测工具可以接收到数据。可是我自已用VICTOR写却不行哈。
帮帮我忙嘛。
--------------------next---------------------
阅读(1349) | 评论(0) | 转发(0) |