#include <LiquidCrystal.h>
const int lcdRS = 12;
const int lcdEN = 11;
const int lcdD4 = 5;
const int lcdD5 = 4;
const int lcdD6 = 3;
const int lcdD7 = 2;
const int backlightPin = 9;
const int potmeterPin = A0;
LiquidCrystal lcd(lcdRS, lcdEN, lcdD4, lcdD5, lcdD6, lcdD7);
void setup() {
lcd.begin(16, 2);
pinMode(backlightPin, OUTPUT);
}
void loop() {
int potmeterValue = analogRead(potmeterPin);
int brightness = map(potmeterValue, 0, 1023, 0, 255);
analogWrite(backlightPin, brightness);
scrollText();
delay(20);
}
void scrollText() {
static bool blinkState = false;
static int scrollPos = 0;
lcd.setCursor(0, 0);
lcd.print((blinkState ? " " : " TEAM "));
lcd.setCursor(0, 1);
lcd.print((blinkState ? " " : " BLACK BULLS!! "));
blinkState = !blinkState;
delay(300);
lcd.scrollDisplayLeft();
scrollPos++;
if (scrollPos >= 16) {
lcd.clear();
scrollPos = 0;
}
lcd.noDisplay();
delay(100);
lcd.display();
delay(100);
}