How to use IRremote library?

i want to send simple hex values using attiny85, but all the examples have tons of code in them so i just can't get how i can send the value, i already spent over 2 hours trying to understand how i can send one simple hex value but none of the codes i tried to write work.

i rememer like year ago or so i tried irremote library and examples seemed simple and i managed to get it working in no time but now the examples look so complex and include every possible protocol so i just can't even understand what is happening in the code

can someone give me example that just sends one hex value in loop,
and example for arduino uno receiving it.

or direct me to tutorial that shows how to send hex value and receive it.

This forum has a search box in the upper-right of the page. I searched for "irsend" and this was one of the first ten (you need to pick the better topic from the list of hundreds).

So how many values are "simple hex values"?
What is the value-range of one hex-value?
8 bit?
16 bit?
32 bit?

what is the final purpose of having transmitted "hex values by IR"?

best regards Stefan

i dont have any spesific bit value that i need, so 8bit would do.
purpose is for controlling ledstrips that are connected to atmega168,

and remote i made using attiny85 has 12 buttons so i need 12 diffrent hex values.

another solution is to use one of the protocols like Sony, NEC, Philiips etc.

and using
the code of the "0"-Button
the code of the "1"-Button
the code of the "2"-Button
etc. etc.
And your receiver uses if-conditions or a switch-case-break statement to realise
program 1
program 2
program 3
..
program 12

this is what my code looks like, it should just send signal every 1 second but i don't know what i should write to "sAddress" "sCommand" "sRepeats"

#include <IRremote.hpp>




void setup()
{
IrSender.begin(1);



}

void loop()
{

IrSender.sendNEC(sAddress, sCommand, sRepeats);
delay(1000);
}

I have no big experience with the irremote-library

The IR-remote library has a lot of examples

But I guess this demo fits pretty good

best regards Stefan

thats the example i was looking at, but it had ton of code so i had hard time understanding whats happening there.

i put this in my code "IrSender.sendNEC(0x0102, 0x34, 10);" to send "0x34" every second,
but receiver "arduino uno" with "receiverDemo" example only says that it receives noise or an unkown protocol.

You have to adjust the receiver to the same protocol.
Without posting your both complete sketches which means

complete sender sketch
complete receiver sketch

it is impossible to support you

best regards Stefan

Programming takes reading and writing. You did not read the link I posted. How many lines do you expect "code" to contain?

i did read it, problem i had actually was that my attiny didn't send ir signals correctly due to fusebits, i had fuses set to propably 8mhz and in Arduino IDE i chose 1mhz, because that was what i tought i set them to.

i tried to copy parts of example code to send ir and tought that i use functions wrong as receiver either got nothing or just some noise, but that wasn't case here lol,

also i tried to use "TinyIRSender.hpp" library, and with that the receiver didn't get signal incorrectly as often as with "IRremote.hpp",

and i expected to have lot less lines as the last time i used the library it was way older version and examples there had lot less code.

i actually got it working :slight_smile:

@StefanL38 @xfpd sry for wasting your time, next time im gonna douple check fuses.

You should post how you prepared the ATtiny85 and the sketches you are using. Someone will know how to get your project running. It is not a waste of time. Just help the helpers.

Note taken

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.