This is my first program for AVR. While building, the code is showing error: conflicting types for 'Encode' implicit declaration of 'Encode'
I have written the following code:
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#define SegDataPort PORTC
#define SegDataPin PINC
#define SegDataDDR DDRC
#define SegCntrlPort PORTD
#define SegCntrlPin PIND
#define SegCntrlDDR DDRD
int main(void)
{
   SegDataDDR = 0xFF;
   SegCntrlDDR = 0xF3;
   SegCntrlPort = 0xF3;
   SegDataPort = 0x00;
   unsigned char adc_value;
   float volt = adc_value/1023;
   int temp = floor(volt*10 + 0.5);
   SegDataPort = Encode(temp1%10);
   //^^^^ implicit declaration of 'Encode' 
   SegCntrlPort = ~0x01;
   SegDataPort = Encode((temp1/10)%10);
   SegCntrlPort = ~0x02;
   SegDataPort = Encode(temp1/100);
   SegCntrlPort = ~0x04;
}
unsigned char Encode(int digit)
{
   unsigned char val;
   switch(digit)
   {
      case 0 : Val = 0b00111111;
      case 1 : val = 0b00000110;
      /// so on till case 9
   }
   return val;
}
I am using ATmega16 as microcontroller. I have also added much more libraries such as math for floor function and others. I have tried changing int to unsigned int, unsigned char and others but it is still not working and showing same error. Please help me.
 
     
    