Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Problem with ir remote library and pwm pins on: February 09, 2013, 04:49:06 pm
It work well till first key is pressed on irremote. After that both ir and pwm functions remains in previous condition. I think the problem is related to the timer of the arduino dueminalove. ie, both ir library and analogWrite function uses the same library. I tried to change the timer used in ir library but it can't create any difference.
2  Using Arduino / Project Guidance / Re: Problem with ir remote library and pwm pins on: February 09, 2013, 03:03:44 pm
Thanks for the information... can you give any solution?. I am using arduino dueminalove.
3  Using Arduino / Project Guidance / Problem with ir remote library and pwm pins on: February 03, 2013, 01:40:13 am
Hello,
I am a newbie in arduino. I want to control the brightness of the led using ir remote. But this doesn't work. I am using irremote.h library.

I think the problem is related to timers. What I have to do???

The code is given below..
Code:

#include <IRremote.h>

int ir_pin = 3;
int pwm_signal=11;
int value;
int x;
int i = 0;
unsigned long start;
unsigned long stp;

IRrecv irrecv (ir_pin);
decode_results results;

void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn();
 pinMode(pwm_signal,OUTPUT);
  
}

void loop()
{
  x = ir_check();
  pwm_write (x);
 Serial.println(x);
}

int ir_check()
{
  if (irrecv.decode(&results))
  {
    if (results.value==2060 || results.value==12)
    {
      Serial.println("on");
      i++;
    }
    irrecv.resume();
  }
 
  return i;
}

void pwm_write (int x)
{
  if (x<10)
  {
    value = x*24;
  }  
   /* digitalWrite(pwm_signal,HIGH);
    delayMicroseconds(value);
    digitalWrite(pwm_signal,LOW);
    delayMicroseconds(1000-value);*/
   analogWrite(pwm_signal,value);
  
 
}
  
     
      
      
    
    
  
Pages: [1]