Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

ADC interface with atmega32 with two sensors

1 post / 0 new
s.manisrinivas's picture
Last seen: 10 hours 9 min ago
Joined: 16/09/2015 - 12:05
ADC interface with atmega32 with two sensors

HI friends ,

  I need help from you that, I am using ATmega32 avr development board for ADC multiple channels  and i am using two POT sensors.What is my doubt is  I want a small delay after two channel conversions,say delay is 2 sec (for example).After every delay conversions have to display.

I tried but i cannot make delay,for i used timer buts its, please help me guys


here is my code.

#define LED PD4 
int main()
uint8_t timerOverflowCount=0;
DDRD=0xff;         //configure PORTD as output
TCCR0 = (1<<CS00) | (1<<CS02);
while ((TIFR & 0x01) == 0); 
 TCNT0 = 0x00;
 TIFR=0x01; //clear timer1 overflow flag              
if (timerOverflowCount>=6)
PORTD ^= (0x01 << LED);