***************************************************** This program was produced by the CodeWizardAVR V1.25.9 Standard Automatic Program Generator © Copyright 1998-2008 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 07.07.2008 Author : F4CG [color=red]Оформите текст программы в виде приложения к сообщению . Модератор Сэр Мурр [/color] Company : F4CG Comments: Chip type : ATmega16 Program type : Application Clock frequency : 11,059200 MHz Memory model : Small External SRAM size : 0 Data Stack size : 256 *****************************************************/ #include #include #include // 1 Wire Bus functions #asm .equ __w1_port=0x18 ;PORTB .equ __w1_bit=0 #endasm #include <1wire> // DS1820 Temperature Sensor functions #include // Alphanumeric LCD Module functions #asm .equ __lcd_port=0x1B ;PORTA #endasm #include // Declare your global variables here char lcd_buffer[33]; /* maximum number of DS18B20 connected to the 1 Wire bus */ #define MAX_DEVICES 8 /* DS18B20 devices ROM code storage area */ unsigned char rom_code[MAX_DEVICES][9]; main() { unsigned char i,j,devices; lcd_init(16); lcd_putsf("CodeVisionAVR\n1 Wire Bus Demo"); delay_ms(2000); lcd_clear(); /* detect how many DS18B20 devices are connected to the 1 Wire bus */ devices=w1_search(0xf0,rom_code); sprintf(lcd_buffer,"%u DS18B20\nDevice detected",devices); lcd_puts(lcd_buffer); delay_ms(2000); /* display the ROM codes for each device */ if (devices) { for (i=0;i