User manual

001 lcd.begin(16, 2)
The basic initialisation is now completed. Now we can use
lcd.setCursor to determine the position of the cursor and thus
the text to be output.
001 lcd.setCursor(0, 0)
The first parameter indicates the position within the row, i.e.
0 to 15 in this case. The second parameter indicates the row
number, i.e. 0 or 1.
Now we can output the text in the specified position at the LCD
with the commandlcd.print.
001 lcd.print("**ARDUINO LCD**”)
We can also see that we always need to write »lcd.« before the
actual function of the LCD output. This specifies that we use
the class lcd that we have integrated with #include <Liquid-
Crystal.h>. Now Arduino™ knows where the call comes from and
which class is responsible for it when »translating«, referred
to as »compiling« by specialists.
If you have ever dealt with the programming language C++ before,
you will recognise by the ending *.cpp, that these are
C++-classes. Arduino™ is basically based on C++. This is a good
way of programming own classes or Library and providing them to
other Arduino™ users.
After this brief C++-excursion, let us return to our example.
Up to now, we still remained in the function
Setup()
-which is gone
through once at all times when starting the program and that is
mostly used for start configuration. In it, we can pre-initialise
variables before the actual program start and pre-configure the
hardware.
The following
Loop()
function is an endless loop that is never
ended. This is the Arduino™-main loop for our program at the same
time. Here, we call the runtime in milliseconds at each run with
the function
millis()
. Division by 1,000 will lead to the output
in seconds. We will represent the program runtime in seconds on
the LCD.
001 lcd.setCursor(5, 1)