Hi All. I have a small home automation project, one of the rooms is monitored by device based on Arduino UNO. Device has LCD screen 16x2 with I2C interface and IR transmitter. My problem is that LCD screen (back light) and IR LED are both using PIN3:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#include <Bounce2.h>
#include <SPI.h>
#include <PubSubClient.h>
#include <Ethernet.h>
#include <IRremote.h>
#define DHTPIN1 8 // what pin we're connected to
#define DHTPIN2 9 // what pin we're connected to
#define BUTTON_PIN 10 // the number of the pushbutton pin
#define I2C_ADDR 0x27 // <<----- Add your address here. Find it from I2C Scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
// Initialize DHT sensor for normal 16mhz Arduino
DHT dht_outdoor(DHTPIN1, DHT22);
DHT dht_indoor(DHTPIN2, DHT11);
// initialize the library with the numbers of the interface pins
LiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);
I tried to google for solution it seems that "IRremote.h" is hard coded to use PIN3 due to some limitation on timer resources. I also tried to assign different PIN for LCD backlight, but it did not work as well, screen remains black:
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
lcd.setBacklight(HIGH);
Is there a way to change PIN3 for IR transmitter or backlight PIN for LCD?