/******************************************************* This program was created by the CodeWizardAVR V3.32 Automatic Program Generator © Copyright 1998-2017 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 19.04.2021 Author : Company : Comments: Chip type : ATmega32 Program type : Application AVR Core Clock frequency: 16,000000 MHz Memory model : Small External RAM size : 0 Data Stack size : 512 *******************************************************/ #include #include #asm .equ __w1_port=0x18;PORTB .equ __w1_bit=0 #endasm #include <1wire.h> #include // Declare your global variables here #define FIRST_ADC_INPUT 0 #define LAST_ADC_INPUT 0 unsigned int adc_data[LAST_ADC_INPUT-FIRST_ADC_INPUT+1]; // Voltage Reference: AVCC pin #define ADC_VREF_TYPE 0x40 // ADC interrupt service routine // with auto input scanning interrupt [ADC_INT] void adc_isr(void) { static unsigned char input_index=0; // Read the AD conversion result adc_data[input_index]=ADCW; // Select next ADC input if (++input_index > (LAST_ADC_INPUT-FIRST_ADC_INPUT)) input_index=0; ADMUX=(FIRST_ADC_INPUT | ADC_VREF_TYPE)+input_index; // Delay needed for the stabilization of the ADC input voltage delay_us(10); // Start the AD conversion ADCSRA|=(1<