6TheNightWhisper9
Newbie level 6
Hi My friends
I'm have an AVR UController ATMEGA8A and using Atmel studio 7 for my code,
want to build an Infra Red remote control with a library that define a class in its header file (IRremote.h),
and as i know C language doesn't support class type (not OOP), so when i compile the program with the name main.c ,I've got a tons of error and after googling the issue i have renamed the "main.c" to "main.cpp" and compiled the app I've stuck with two errors
Error recipe for target 'RemoteCtrl.elf' failed RemoteCtrl E:\Projects\ATMEL UController\RemoteCtrl\Debug\Makefile 96 Build
Error ld returned 1 exit status RemoteCtrl collect2.exe 0 Build
my code
and i've attached the library files.
so pls any one can help :bang: :bang: :bang:
I'm have an AVR UController ATMEGA8A and using Atmel studio 7 for my code,
want to build an Infra Red remote control with a library that define a class in its header file (IRremote.h),
and as i know C language doesn't support class type (not OOP), so when i compile the program with the name main.c ,I've got a tons of error and after googling the issue i have renamed the "main.c" to "main.cpp" and compiled the app I've stuck with two errors
Error recipe for target 'RemoteCtrl.elf' failed RemoteCtrl E:\Projects\ATMEL UController\RemoteCtrl\Debug\Makefile 96 Build
Error ld returned 1 exit status RemoteCtrl collect2.exe 0 Build
my code
Code:
#define recvPin 0
#define outPutPin1 1
#define outPutOin2 2
#include <avr/io.h>
#include <util/delay.h>
#include "IRHeaders/IRremote.h"
int main(void)
{
DDRC=0b00000110; //DDRC=(1<<2|1<<1|1<<0);
IRrecv irrRecv(recvPin);
decode_results results;
irrRecv.enableIRIn();
while (1)
{
if(irrRecv.decode(&results) )
{
switch(results.value)
{
case 0xFD00FF:
// the required action 1
break;
case 0xFD807F:
// the required action 2
break;
}
irrRecv.resume();
}
}
}
and i've attached the library files.
so pls any one can help :bang: :bang: :bang: