ATtiny13A/45/85

Hello, I am a beginner with Arduino and working on a simple IR Remote using ATtiny13A and ATtiny85 for my Samsung Air Conditioner. The original remote got damaged and I could able to retrieve the HEX codes from another similar AC remote. I just want to build a remote with three buttons., POWER ON/OFF, TEMP RAISE and TEMP Lower.

I am familiar with using Arduino as ISP Programmer and download the code in to ATtiny85. Can someone help me with an example code for three pushbuttons and IR emitter to throw the defined HEX codes?

There are surely example code around where You find the needed library. Those examples will likely bring the basics You need.

Hi, where to explore the examples?

Hi,
see this site.

https://irforum.analysir.com/viewtopic.php?t=413

RV mineirin

Hi, I have the required HEX codes already. What I am looking for is the code for ATTINY85 to transmit through the IR transmitter.

Please advise.

Install the IRremote library and in the IDE, select File > Examples > (Examples from custom libraries) IRremote > etc.

In what format are the captured codes and do you know what IR protocol does the air conditioner uses. ?
Posts the codes you have captured here. They may be easily identifiable.

Hi, I have installed the IRRemote library through the library manager. WOuld you please help me understand how to utilize the examples in building the code to send out

ON Command - 6B48AF59
OFF Command - 1524EBB

Temp setpoint -

Hi, I am referring to the attached code, where I intend to use the above codes....but, upon trying to put this code in to ATtiny85 through Arduino as ISP Programmer, the below is the error
#error "Please ensure chosen MCU is either 88, 168, 168P, 328P, 32U4, 2560 or 256RFR2."

The LowPower library is also attached.

Please help.

Arduino_universal_remote.ino (1.19 KB)

LowPower.zip (10.6 KB)

Form the reference for the LowPower library

:

Low-Power

Lightweight low power library for Arduino.

Version: 1.81

Date: 21-01-2020

Devices Supported:

ATMega88
ATMega168
ATMega168P
ATMega328P
ATMega32U4
ATMega644P
ATMega1284P
ATMega2560
ATMega256RFR2
ATSAMD21G18A

I do not see tiny85 on that list.

What board do you have selected in the Tools menu? What programmer?

In the future, please post code here so we do not have to download it.

Hi, I am using the uC ATtiny85. I came to know that ATtiny85 uC is not supported by this library. Is there any way to exclude this LowPower library and write a generic code to use my uC ATtiny85?

#include <IRremote.h>
#include "LowPower.h"

IRsend irsend;

const int b1 = 2;
const int b2 = 4;
const int b3 = 5;
const int b4 = 6;
const int b5 = 7;
const int b6 = 13;

int timer;
int modeCounter = 0;

void wakeUp() {
timer = 0;
}

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(b1, INPUT);
pinMode(b2, INPUT);
pinMode(b3, INPUT);
pinMode(b4, INPUT);
pinMode(b5, INPUT);
pinMode(b6, INPUT);
}

void loop() {
attachInterrupt(0, wakeUp, HIGH);
while (timer < 10000) {
if (digitalRead(b1) == HIGH) {
timer = 0;
delay(50);
irsend.sendNEC(0xA90, 32);
}

if (digitalRead(b2) == HIGH) {
timer = 0;
delay(50);
irsend.sendNEC(0xC90, 32);
}

if (digitalRead(b3) == HIGH) {
timer = 0;
delay(50);
irsend.sendNEC(0x90, 32);
}

if (digitalRead(b4) == HIGH) {
timer = 0;
delay(50);
irsend.sendNEC(0x890, 32);
}

if (digitalRead(b5) == HIGH) {
timer = 0;
delay(50);
irsend.sendNEC(0xEFE421, 32);
}
delay(1);
timer = timer + 1;

}

LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
}

You originally had 2 codes. Now you have 6, all of which are different from the original codes. How have you collected these?
You have an ATtiny85 and appear to want to make 6 connections to it. Some development systems do support using 6 GPIO pins (by reusing the reset pin) but these may have other problems. Which development system are you using?
Can you make a simple test with sending one code to you air conditioner before advancing to a 6 button system. That is without the initial complexity of the low power library.