这个去哪儿找啊,我程序也有一个就是调不成功!悲剧啊!
#include
#define DATA_DIR_OUTPUT P2DIR|=BIT2
#define DATA_DIR_INPUT P2DIR&=~BIT2
#define DATA_H P2OUT|=BIT2
#define DATA_L P2OUT&=~BIT2
#define DATA_IN ((P2IN&BIT2)>>2)
//#define DATA_IN ((PINC & BIT(PC0)) >> PC0)
unsigned int temperature;
unsigned int humidity;
void delay_1us(void) //1us延时函数
{
_NOP();
}
void delay_nus(unsigned int n) //N us延时函数
{
unsigned int i=0;
for (i=0;i=1;
//1字节结束
if(bit==0x0000)
{
p++;
bit=0x8000;
}
}
return 1;
}
void main()
{
WDTCTL=WDTPW+WDTHOLD;
get_DHT11_value( );
}