/*
Arduino | coding-help
fif3x FUS
7/23/25 — 10:55 AM
i dont know why but my code doesnt work as expected...
when the minutes are for example 15, the led on pin 8 should light up..
here is my code:
*/
#include <LiquidCrystal.h>
/*
LCD type below (16*2)
0A-1A-2A-3A-4A-5A-6A-7A-8A-9A-10A-11A-12A-13A-14A-15A
0B-1B-2B-3B-4B-5B-6B-7B-8B-9B-10B-11B-12B-13B-14B-15B
A = row #0
B = row #1
*/
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int seconds = 55;
int minutes = 14;
int hours = 0;
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
pinMode(8, OUTPUT);
digitalWrite(8, HIGH);
// Print a message to the LCD.
lcd.print("FIFEX");
lcd.print(" H2O");
lcd.print(" :3");
lcd.setCursor(0, 1);
lcd.print(":)");
delay(1000);
digitalWrite(8, LOW);
}
void loop() {
// scroll 21 positions (string length + display length) to the right
// to move it offscreen right:
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
if (minutes == 15 && seconds == 0) {
digitalWrite(8, HIGH);
} else if (minutes == 30 && seconds == 0) {
digitalWrite(8, HIGH);
} else if (hours == 1 && minutes == 0 && seconds == 0) {
digitalWrite(8, HIGH);
} else {
}
if (seconds > 59) {
seconds = 0;
minutes++;
}
if (minutes > 59) {
minutes = 0;
hours++;
}
lcd.setCursor(8, 1);
lcd.print(hours); lcd.write(':');
if (minutes > 9) {
lcd.print(minutes);
} else {
lcd.write('0'); lcd.print(minutes);
}
lcd.write(':');
if (seconds > 9) {
lcd.print(seconds);
} else {
lcd.write('0'); lcd.print(seconds);
}
lcd.print(" i <3 C++");
lcd.print(" LLTD");
// scroll one position right:
lcd.scrollDisplayRight();
// wait a bit:
delay(1000);
seconds++;
digitalWrite(8, LOW);
}
}