Pages: [1]   Go Down
Author Topic: Error IRremote  (Read 876 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys who knows why I get this error, and what should I do?
I am a Arduino Due.



but when I put Tools -> Board -> Ardino Uno   everything works

I get the same error with  Arduino Due when I put other libraries.
« Last Edit: March 03, 2013, 10:29:46 am by LaMega » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post your whole code.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
String stato;

void setup()
{
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value);
   
    if(results.value == 16767525){
    stato = "acceso1";
    digitalWrite(2, HIGH);
    }
    else if (results.value == 16773645) {
    stato = "acceso2";
    digitalWrite(3, HIGH);
    }
    else if (results.value == 16763445) {
    stato = "acceso3";
    digitalWrite(4, HIGH);
    }
    else if (results.value == 4294967295) {
    stato = "mantieniacceso";
    }
    else {
    stato = "spento";
    };
   
    if(stato == "acceso1"){
    digitalWrite(2, HIGH);
    }
    else if (stato == "acceso2") {
    digitalWrite(3, HIGH);
    }
    else if (stato == "acceso3") {
    digitalWrite(4, HIGH);
    }
    else if (stato == "mantieniacceso") {
    }
    else if (stato == "spento") {
    digitalWrite(4, LOW);
    digitalWrite(3, LOW);
    digitalWrite(2, LOW); 
    };   
   
   
   
    irrecv.resume(); // Receive the next value
  }
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure but i think the current IRremote Lib will not work with the Due at all.
I'm also searching a way to make it work together by the way, so any help is welcome smiley
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 139
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The library seems to use avr specific interrupt functions. It needs to be rewritten to work with Due.
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Pages: [1]   Go Up
Jump to: