A structure is a user-defined a composite data type that is used to group multiple variables together. The variables in a structure may be of different types enabling us to store related data, of different types, together. The following code shows the syntax of how we would define a structure:
struct name { variable list . . };
When a structure is defined, the struct keyword is used followed by the name of the structure. The variable list is then defined between the curly brackets.
Let's take a look at how we can create and use a structure by changing the previous sketch, which used the analogRead() function to read the TMP36 temperature, to use a structure. The first thing we need to do is to define a structure that will store the temperature information from the sensor. We will name this structure tmp36_reading, and it will contain three variables all of...