To control the speed of a DC Motor using PWM and measure its RPM using optical sensor and displays them on LCD

Hi for everybody,
I am Tibor from Hungary and just working on an Arduino project namely to control the speed of a DC Motor using PWM and measure its RPM using optical sensor and displays them on LCD.
I found a paper on that problem at the Internet applying the circuit as it follows:

The paper consists of the code too and its first two row is:
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

I can not realise why they wrote „LiquidCrystal lcd(8, 9. 10, 11, 12, 13)”, I think so it should be: „LiquidCrystal lcd(12, 11, 5, 4, 3, 2))”.

My another problem that I have a VST395 speed sensor instead of MOC7811 and not found information on how to build it into the circuit.

Please explain me the above things.

This

LiquidCrystal lcd(8, 9. 10, 11, 12, 13)

tells the code how you have your LCD wired.

I suggest you find a simple complete example that does nothing more that pritn "Hello World!" on your LCD.

Either wire it exactly the way the example does, or change the numbers to reflect how you have chosen to wire your LCD.

And I hope you are using commas where they are expecting, not periods.

   LiquidCrystal lcd(8, 9, 10, 11, 12, 13)

Here, get this working

https://docs.arduino.cc/learn/electronics/lcd-displays/

Step by step.

HTH

a7

Thank you for your reply. I know what these numbers tell in the code, but by the schematic view of the circuit nothing is connected to some of these pins, but they are wired to the digital pins to Arduino board mentioned in

 LiquidCrystal lcd(2, 3, 4, 5, 11, 12)

This is my question?!

alto777 via Arduino Forum <notifications@arduino.discoursemail.com> ezt írta (időpont: 2024. jún. 20., Cs, 17:15):

The meanings are described with the help of Fig-1:


Fig-1:

#define RS 8
#define E 9
#define D4 10
#define D5 11
#define D6 12
#define D7 13
LiquidCrystal lcd(RS, E, D4, D5, D6, D7);

Or

LiquidCrystal lcd(8, 9, 10, 11, 12, 13);  //RS=8, E=9, D4=10, D5=11, D6=12, D7=13

Please find attached the paper on the control, measurement and display of the rpm of DC motor.

Tibor Várszegi <tiborvarszegi5@gmail.com> ezt írta (időpont: 2024. jún. 20., Cs, 17:33):

EXAMPLE_on_speed_control_measurement_and_display_by_arduino.pdf (286 KB)

Thank you very much indeed. That makes sense to me. I will try it.

gm via Arduino Forum <notifications@arduino.discoursemail.com> ezt írta (időpont: 2024. jún. 20., Cs, 17:52):