#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
int pole[4][5];
int cas = 0;
void setup() {
lcd.init();
lcd.backlight();
Serial.begin(9600);
// Initialize the positions of the stars in the first row
for (int i = 0; i < 5; i++) {
pole[0][i] = random(0, 20);
}
}
void loop() {
if (millis() >= cas) {
lcd.clear();
for (int y = 0; y < 4; y++) {
for (int i = 0; i < 5; i++) {
if (pole[y][i] >= 0) {
lcd.setCursor(pole[y][i], y);
lcd.print("*");
}
}
}
for (int y = 3; y > 0; y--) {
for (int i = 0; i < 5; i++) {
pole[y][i] = pole[y - 1][i];
}
}
for (int i = 0; i < 5; i++) {
pole[0][i] = random(0, 20);
}
cas += 500;
}
}