This article begins a series of posts, or rather, lessons on the programming of Arduino boards. The basic language we will use is the C language, a programming language that has made the history of computing and that many of us have used to develop many projects on many other platforms.
In the previous article you saw the sketches, how they are structured and the elements that make it up. In this second article on programming with Arduino you will see a fundamental element: the functions and the role they play. At the end of this lesson, you will be able to recognize a function within a sketch, and you will have all the necessary knowledge on how to define them and use them for your purposes and projects.
Python is a language that is processed in real time through an interpreter, also called Python. So there is no need to compile the code before running it.
The Python console is a program that allows you to enter Python commands one line at a time. This is called REPL (Read-Eval-Print-Loop).
Python allows you to perform arithmetic calculations in real time as if it were a calculator. You can directly enter values for operations on a single line.
Floats, or floating numbers, are decimal numbers, that is, those that have a comma (0.24, -3.1423333). These numbers can be defined directly by writing the number with a comma, or using operators that generate decimal numbers such as divisions between integers.
Sometimes in some algorithms it is necessary to know in the division operations, not the result, but the quotient and rest values. The operation is often also called a module (11 module 3)
In Python you can use text and you can do it with strings. You can define a string using both the single and the double quotation mark.
Often during the execution of a program, it is necessary to bring back some text strings (output) on the console. You have already seen that the print() function is used to correctly report a string or a variable.
Perhaps the most used operation on strings is the concatenation of two or more strings. In other words, it is often necessary to combine several strings to form longer sentences.