LCD with shift register issues

#include <SPI.h>
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <LiquidCrystal.h> // include the library
const int data_pin = D6;
const int latch_pin = D7;
const int clock_pin = D8;
LiquidCrystal lcd(D6, D7, D8); // data_pin, latch_pin, clock_pin

String LoveMessage;
bool newMessageReceived;

int screenWidth = 16;
int screenHeight = 2;
int n;
int i;

byte heart[8] = {
B00000,
B00000,
B01010,
B10101,
B10001,
B01010,
B00100,
B00000
};

int stringStart, stringStop = 0;
int scrollCursor = screenWidth;

AsyncWebServer server(80);

const int buttonPin = D4;
const int ledPin = D2;
const int ledPin2 = D3;

int brightness = 0;
int fadeAmount = 5;

int buttonState = 0;

// REPLACE WITH YOUR NETWORK CREDENTIALS
const char* ssid = "BEN";
const char* password = "KappaSigma";

const char* PARAM_INPUT_1 = "input1";

// HTML web page to handle 1 input fields (input1,)
const char index_html[] PROGMEM = R"rawliteral(

Love Memo Type here your messsage:
)rawliteral";

void notFound(AsyncWebServerRequest *request) {
request->send(404, "text/plain", "Not found");
}

void setup() {
Serial.begin(115200);
lcd.begin(screenWidth, screenHeight);

// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);

newMessageReceived = false;

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("WiFi Failed!");
return;
}
Serial.println();
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());

// Send web page with input fields to client
server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) {
request->send_P(200, "text/html", index_html);
});

// Send a GET request to <ESP_IP>/get?input1=
server.on("/get", HTTP_GET, [] (AsyncWebServerRequest * request) {

String inputParam;
// GET input1 value on <ESP_IP>/get?input1=<inputMessage>
if (request->hasParam(PARAM_INPUT_1)) {
  LoveMessage = request->getParam(PARAM_INPUT_1)->value();
  inputParam = PARAM_INPUT_1;
  newMessageReceived = true;
}
else {
  LoveMessage = "No message sent";
  inputParam = "none";
}

request->send(200, "text/html", "HTTP GET request sent to your Lovebox ("
              + inputParam + ") with text: " + LoveMessage +
              "<br><a href=\"/\">Return to Home Page</a>");

});
server.onNotFound(notFound);
server.begin();
}

void loop() {
buttonState = digitalRead(buttonPin);

if (newMessageReceived) {
fade();
if (buttonState == LOW) {
digitalWrite(ledPin, LOW);
digitalWrite(ledPin2, LOW);
n = (LoveMessage.length() + 17);
for (i = 0; i < n; i++) {// Loop to do "something" n times
scrollMessage();
}
newMessageReceived = false;
delay(1000);
lcd.clear();
}
}
}

void fade() {
analogWrite(ledPin, brightness);
analogWrite(ledPin2, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
}

void scrollMessage() {
lcd.setCursor(scrollCursor, 1);
lcd.print(LoveMessage.substring(stringStart, stringStop));
lcd.createChar(0, heart);
lcd.setCursor(0, 0);
lcd.print(char(0));
lcd.setCursor(2, 0);
lcd.print(" YOUR LOVER ");
lcd.setCursor(15, 0);
lcd.print(char(0));
delay(250);
lcd.clear();
if (stringStart == 0 && scrollCursor > 0) {
scrollCursor--;
stringStop++;
} else if (stringStart == stringStop) {
stringStart = stringStop = 0;
scrollCursor = screenWidth;
} else if (stringStop == LoveMessage.length() && scrollCursor == 0) {
stringStart++;
} else {
stringStart++;
stringStop++;
}
}

Here is my error message: no matching function for call to 'LiquidCrystal::LiquidCrystal(const uint8_t&, const uint8_t&, const uint8_t&)'

I'm trying to use the LCD screen with a shift register the shift register is SN74HC595N 8-bit, I'm not sure if im including the correct library I also need help with that.

Thank you so much any help is appreciated

Ref
LiquidCrystal_74HC595 - Arduino Reference

Now I'm getting this error: no matching function for call to 'LiquidCrystal_74HC595::LiquidCrystal_74HC595(int, int, int)'

I have deleted your other cross-post @nicholsonba.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

The code needs to be properly posted, I cannot read it. I would also like to see a schematic as to how you have wired it showing all power, grounds, and interconnections.






Here is the schematic and code with pictures hopefully this helps, I found some code someone else was using, the error I'm getting now is this line: #include <LiquidCrystal595.h> // include the library, I can't seem to find a library for the LiquidCrystal595.h, Here is the new error cute: LiquidCrystal595.h: No such file or directory

https://github.com/tehniq3/LiquidCrystal595

sketch_mar15d.ino (4.5 KB)
Here is the code, I'm still having issues:(

Hi,
post LiquidCrystal595.h link .

Nope, you have a search engine, your best tool, used it and I searched for "post LiquidCrystal595.h" . The first hit was from "Codebender LiquidCrystal595 (LiquidCrystal595 .h ). Arduino 1.x Library for driving an LCD using a 74HC595 shift register and only 3 pins, not the usual 6."

I did not understand your comment.

I'm here to help, not to search the web for libraries used in projects. :rage:

Since OP have used this library, must have downloaded it from some site.

1 Like

I used the library I have here:
" GitHub - tehniq3/LiquidCrystal595: Connect a 16x2 LCD with 3 instead of 6 pins - original was at http://rowansimms.com/ (here is a back-up) "

(I don't know if it's the same as the one you're using), and it worked correctly.

A message appeared on the LCD.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.