Dear Members,
I'am trying to define a function(a simple function which make a led on/off) and add it to main source code by including a header but the main source couldn't determine/define the function. I recieve below error:
********* main.c12: undefined reference to 'ledon' ********
Would you please tell me where is problem?
%%%%%%%%% here is the codes %%%%%%%%%
main:
------------------------
#include <avr/io.h>
#include <util/delay.h>
#include "ledon.h"
int main()
{
DDRA=0xff;
while(1)
{
ledon();
}
}
--------------------------- Function( it's a simple function which make a led on/off---------
void ledon()
{
PORTA |= 0x80;
_delay_ms(100);
PORTA &= ~0x80;
_delay_ms(100);
}
------------------------- header---------------------
#ifndef MYHEADER_H
#define MYHEADER_H
void ledon();
#endif