[an error occurred while processing this directive]
|
volatile __eeprom unsigned char ScratchPad1[9] = {0,0,0,0,0,0,0,0,0};
volatile __eeprom unsigned int temper;
volatile __eeprom unsigned char CRC_R = 0, CRC_P = 0;
volatile unsigned int CtrlT0;
volatile unsigned int temperature_buf;
volatile unsigned int temperature_buf1;
volatile FLAG flag =
{
0,
0,
0,
0,
0,
0,
0
};
int main( void )
{
unsigned char ScratchPad[9];
CRC_R = 0;
CRC_P = 0;
DS1820_StartTemperatureConverting();
delay_ms(1500);
DS1820_ReadScratchPad(ScratchPad);
CRC_R = OneWireCRC(ScratchPad, 8);
CRC_P = ScratchPad[8];
temper = DS1820_ReadTemperature(ScratchPad);
while (1)
{
DS1820_StartTemperatureConverting();
delay_ms(1500);
DS1820_ReadScratchPad(ScratchPad);
}
}