#include"reg51.h"
#defineucharunsignedchar
#defineuintunsignedint
sbitSCLK=P2^2;
sbitSID=P2^1;
sbitCS=P2^0;
voiddelay(uintv)/*延時*/
{
while(v!=0)v--;
}
voidser_in(ucharc)/*serial輸入程序*/
{
ucharBitCnt;
for(BitCnt=0;BitCnt<8;BitCnt++)
{
if((c<