Go Down

Topic: Error IRremote (Read 1 time) previous topic - next topic

LaMega

Mar 03, 2013, 12:33 pm Last Edit: Mar 03, 2013, 04:29 pm by LaMega Reason: 1
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.


LaMega

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
  }
}

p0fi

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 :)

Gericom

The library seems to use avr specific interrupt functions. It needs to be rewritten to work with Due.
Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy