?? slave.c
字號:
/*-----------------------------------------------------------------------------------------
04-10-24 modified ysd transfer data bug and add shortdelay() function
------------------------------------------------------------------------------------------*/
#include "reg52.h"
#include "main.h"
extern unsigned char data R_count;
extern unsigned char data data1;
extern void delay1ms(unsigned char count);
extern void send_char_com(unsigned char ch);
void slave(void)
{
unsigned int i=0;
unsigned char tbuf[8];
RT_CON=1;
delay1ms(1);
tbuf[0]=0x2a;
tbuf[1]=0x06;
tbuf[2]=0x01;
tbuf[3]=0x00;
tbuf[4]=0xb0;
tbuf[5]=data1;
tbuf[6]=~P0;
tbuf[7]=tbuf[0]+tbuf[1]+tbuf[2]+tbuf[3]+tbuf[4]+tbuf[5]+tbuf[6];
do
{
send_char_com(tbuf[i]);
// delay1ms();
i++;
} while(i <8 );
RT_CON=0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -