I am very frustrated right now. Every time I use my LCD screen, after like 2 tries, it starts corrupting with random characters. Ive tried switching pins, ive tried writing different code, nothing is working. Can somebody please help me with this??
/*
* Arduino LCD Tutorial
*
* Crated by Dejan Nedelkovski,
* www.HowToMechatronics.com
*
*/
#include <LiquidCrystal.h> // includes the LiquidCrystal Library
LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
const char BUTTON_PIN = 9;
bool pressed = false;
void setup() {
Serial.begin(115200);
pinMode(BUTTON_PIN, INPUT_PULLUP);
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display }
lcd.print("SMALLOS 2.0");
}
void loop() {
bool currentState = digitalRead(BUTTON_PIN);
if (currentState == pressed) {
Serial.println("Hello");
while(digitalRead(BUTTON_PIN) == pressed) {
}
}
}
