I have 2 example codes id like to combine and use but they both use pins a4 and a5 iv tryed to adjust them but cant find out what to change
for lcd out with only 4 wires
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is
#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
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,4,5,D6_pin,D7_pin);
and for my time keeper
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is
#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
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,4,5,D6_pin,D7_pin);
any idea where i have to go to change the pins that are assigned to them
searched for the answer first but even with that info you gave me still have not found it
full code that i run for lcd
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is
#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
int n = 1;
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,4,5,D6_pin,D7_pin);
void setup()
{
lcd.begin (20,4,LCD_5x8DOTS);
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); // init the backlight
}
void loop()
{
lcd.setBacklight(LOW); // Backlight off
delay(3000);
// delay(3000);
lcd.on(); // Switch fully on the LCD (backlight and LCD)
delay(3000);
//lcd.setBacklight(HIGH);
lcd.home (); // go home
lcd.print("ABCDEFGHIJKLMNOPQRST");
lcd.setCursor ( 0, 1 ); // go to the next line
lcd.print("UVWXYZ 0123456789 ");
lcd.setCursor ( 0, 2 ); // go to the next line
lcd.print("abcdefghijklmnopqrst");
lcd.setCursor ( 0, 3 ); // go to the next line
lcd.print("uvwxyz <>!?@#$%&*() ");
// Backlight on
delay(3000);
lcd.on(); // Switch fully on the LCD (backlight and LCD)
delay(3000);
}
void wipeLines() {
for (int y = 0; y < 4; y++)
{
for (int x = 0; x < 20; x++)
{
lcd.setCursor (x,y);
lcd.print(" ");
delay(10);
}
}
}
full code for clock
#include <Wire.h>
#include <Time.h>
#include <DS1307RTC.h>
void setup() {
Serial.begin(9600);
while (!Serial) ; // wait for serial
delay(200);
Serial.println("DS1307RTC Read Test");
Serial.println("-------------------");
}
void loop() {
tmElements_t tm;
if (RTC.read(tm)) {
Serial.print("Ok, Time = ");
print2digits(tm.Hour);
Serial.write(':');
print2digits(tm.Minute);
Serial.write(':');
print2digits(tm.Second);
Serial.print(", Date (D/M/Y) = ");
Serial.print(tm.Day);
Serial.write('/');
Serial.print(tm.Month);
Serial.write('/');
Serial.print(tmYearToCalendar(tm.Year));
Serial.println();
} else {
if (RTC.chipPresent()) {
Serial.println("The DS1307 is stopped. Please run the SetTime");
Serial.println("example to initialize the time and begin running.");
Serial.println();
} else {
Serial.println("DS1307 read error! Please check the circuitry.");
Serial.println();
}
delay(9000);
}
delay(1000);
}
void print2digits(int number) {
if (number >= 0 && number < 10) {
Serial.write('0');
}
Serial.print(number);
}