Hi. I am trying to make IR transmitter circuit for TV or anything, with ATtiny85. My code works on arduino ,it sends every hex code I want. But when I load my code in attiny 85 circuit works my IR led blinks but doesnt sends my hex value. Just sending 0x000 unknown cammanded codes or sends RC5 0xXXXXX codes. I tried every think i'm tired and wasted my time for a 2 week. Can anyone help me. I just want system that will have only one button and send only one hex code. What am ı have to do for it?
my code:
#include <IRremote.h> #define buton 2 //button input #define IR 1 // LED output
int durum = 0;
Yes everthing okey with the values code works with arduino nanoe but when I upload this code in attiny85 doesnt send my hex value. Only sending 0x0000 RC-5 or unknown hex values.
Here is a successfully tested sketch that sends what you want using an IR LED and button switch attached to a tiny85 as shown in the attached schematic. Receiver is an Uno with an IR detector.
I use the state change detection method to send only once for each button press. And the switch is wired to ground and the internal pull up is enabled. That is the preferred way to wire a switch.
I thought you were working with a tiny85. I went to some trouble to wire a circuit with a tiny85, write and test the code. Did I waste my time trying to help you get the IR send to work with a tiny85?
Post a schematic of the wiring. Label the parts.
Post the receiver test code. Post the sender test code.
I was running my tiny85 at 8MHz internal clock when I tested the code that I posted. I saw that you had 1MHz set. I bootloaded my tiny85 to 1MHz and tried the code that I posted. I get garbage on the receiver. As soon as I put the clock back to 8MHz, it was getting received properly. It looks like 1MHz is slow to get the IR protocol timing right.
okey ı'll try that also ı tried your code with arduino nano its worked now ı am gonna try with attiny. İf it will not works again probably my attiny cracked i'll change my attiny . Thnx for your help man u are the best person in the world wait my good news
Thank you man. Its probably must work ,but doesnt works on my attiny85. I overheated my tiny85 in my first attempts, so it may have malfunctioned. I'll buy another tiny85 and make this circuit again :D. I will write here again in about 4 days. I hope all your wishes come true.
How we'll do that ? By the way, he tried the above circuit himself and was able to send the hex code without any clock adjustment. If I'm not mistaken, it automatically sets the clock inside the IRremote library.