亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

ReceiveData

  • WinCE下利用COPYDATA消息在進程間發送和接收數據代碼實例 1.SendData工程文件 2.ReceiveData工程文件

    WinCE下利用COPYDATA消息在進程間發送和接收數據代碼實例 1.SendData工程文件 2.ReceiveData工程文件

    標簽: ReceiveData COPYDATA SendData WinCE

    上傳時間: 2016-11-08

    上傳用戶:

  • 24c01a的讀寫程序

    #include <at24c01a.h>/*************************************************向24C01A寫入一個字節輸入:E2ROM地址,字節數據******************************************************/void write24c01a(uchar uadd_1,uchar udata_1){sendbyte=0xa0;start();send(sendbyte);if (!ack())continue;send(uadd_1);if (!ack())continue;send(udata_1)if (!ack())continue;stop();}/**********************************發送開始*****************************************/void start(void){a_scl=1;a_sda=1;a_sda=0;a_scl=0;a_scl=1;}/********************************************發送停止*******************************************/void stop(void){a_scl=0;a_sda=0;a_scl=1;a_sda=1;} /*********************************************發送反饋************************************************/bit ack(void){int a_acka_scl=0;a_scl=0;a_scl=0;a_scl=1;a_ack=a_sda;a_scl=0;return(a_ack)}/**************************************發送無反饋********************************************/bit noack(void){int a_ack;a_scl=1;a_scl=1;a_scl=0;}/*******************************************發送****************************************************/void send(uchar  undata){uchar i;sendbyte=undatafor(i=8;i>0;i--){a_sda=sendbyte7;a_scl=0;a_scl=1;sendbyte=sendbyte<<1}}/********************************************接受****************************************************/ void   receive(void){int i;uchar data;for(i=8;i>0;i--){ a_scl=1;receivebyte7=a_sda;a_scl=0;receivebyte=receivebyte>>1}ReceiveData=receivebyte;}/********************************************向 24c01a讀一個字節;輸入:EEROM地址;輸出:EEROM數據;********************************************/void read24c01a(uchar  counter){receivebyte=0xa1;start();send(receivebyte);if (!ack())continue;send(counter);if (!ack())continue;receive()noack();stop();}

    標簽: 24c01a 讀寫程序

    上傳時間: 2013-12-23

    上傳用戶:wxhwjf

  • procedure senddata var i:integer commflg : Boolean begin commflg:=true for i:=1

    procedure senddata var i:integer commflg : Boolean begin commflg:=true for i:=1 to 8 do begin if not fcomm comml writecommdata(sendbutter,i) then begin Commflg=false break end end end (4) 接收數據 在編寫基于串口的計算機工業測控時,通常需要由下位機向PC機發送數據以使PC機了解系統的測試數據或下位機的運行狀態,并進而控制下位機的行為。利用Spcomm串口控件接收下位機發送的數據信息的示例代碼如下: //事件驅動方式接收數據程序 procedure TForm1.CommlReceiveData(Sender:Tobject Buffer:Pointer bufferLength:Word) var ReceiveData:array of byte begin sleep(100) //等待100ms,保證接收到所有數據 move(buffef ,ReceiveData,bufferlength) //將接收緩存區中的數據轉移到數組中 …… end (5) 關閉串口 在系統開發中,應注意在不使用串口時應及時關閉串口,釋放系統資源,否則可能會影響系統的其它應用。關閉串口的代碼如下: procedure TForm1.FormClose ( Sender TObj ect:var Action:TCIoseAction ) begin comml.StopComm end

    標簽: commflg procedure senddata integer

    上傳時間: 2014-01-26

    上傳用戶:懶龍1988

主站蜘蛛池模板: 漾濞| 方正县| 隆昌县| 深水埗区| 墨玉县| 奉新县| 定日县| 平凉市| 疏附县| 福贡县| 都江堰市| 青冈县| 同仁县| 沁水县| 名山县| 神池县| 巩义市| 周口市| 洪雅县| 阿瓦提县| 徐汇区| 黎城县| 东海县| 望奎县| 尼勒克县| 武强县| 营口市| 温宿县| 孝感市| 丹巴县| 卫辉市| 贵州省| 通城县| 富顺县| 樟树市| 金乡县| 岳池县| 沂源县| 吴江市| 贡觉县| 海伦市|