Требуется программист в Зеленограде
- обработка данных с датчиков; ColdFire; 40 тыс. e-mail:jobsmp@pochta.ru |
// 1 Wire Bus functions
#asm
.equ __w1_port=0x12 ;PORTD
.equ __w1_bit=0
#endasm
#include <1wire.h>
// DS1820 Temperature Sensor functions // maximum number of DS1820 devices В главной функции выполняю следущее: // Determine the number of DS1820 devices sprintf(buffer2,"%u",ds1820_devices ); while (1) Но датчик, висящий на PD0 не обнаруживается.
#include
// connected to the 1 Wire bus
#define MAX_DS1820 8
// number of DS1820 devices
// connected to the 1 Wire bus
unsigned char ds1820_devices;
// DS1820 devices ROM code storage area,
// 9 bytes are used for each device
// (see the w1_search function description in the help)
unsigned char ds1820_rom_codes[MAX_DS1820][9];
// connected to the 1 Wire bus
ds1820_devices=w1_search(0xf0,ds1820_rom_codes);
lcd_gotoxy(0,0);
lcd_puts(buffer2);
delay_ms(1000);
{
// Place your code here
for (i=0;i
temp=ds1820_temperature_10(&ds1820_rom_codes[dsi][0]);
sprintf(buffer2,"t%-u=%-i.%-u\xf8C",++dsi,temp/10,abs(temp%10));
lcd_puts(buffer2);
}
}
В чём прикол?
Ответы