Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] Can't compile IRemote header in Atmel studio 7

Status
Not open for further replies.

6TheNightWhisper9

Newbie level 6
Joined
Mar 7, 2018
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
90
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
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:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top