Chapter 6: The C Language
Now that we have had a chance to take a look at how the Arduino language is going to look, we are going to take this to another level and look a bit more at the C language.
This is one of the best options to use when it comes to working on the Arduino board, and it is worth our time to work with this one and learn some of the basics that happen with it.
You will find that as you go through working on this language, that it is going to be parts that you can work with that may be a bit confusing and not make all that much sense until you actually run the program, which is going to take it a bit harder for us to work with compared to other languages.
But the instruments that are going to work out well on this kind of controllers, such as the sensors and the LEDs, are going to depend on the specific outputs and inputs that we will work on here.
And many of the different programming languages that we can find online and more can handle the work that we want to do with the Arduino board, but you will find that the C language is often seen as the best, and that is the one that we will focus on here.
A primary system for any kind of technology that we want to work with is going to consist of what is known as the control device, which is going to refer back to the CPU or the actual microcontroller that we were spending some time talking about before.
There are also going to be a few differences that are going to show up when we pick a specific controller to work with as well.
But, keep in mind that these controllers are not going to be as powerful compared to what we see with a standard microprocessor.
It is still going to contain the input, the output ports, and the hardware functions that we want.
You will find here that the microprocessors that we are talking about are going to be connected back to the external memory.
Generally, the controllers are going to contain the right amount of memory onboard.
However, when we say this, we are not really talking about the larger sizes.
It is possible for the controller that we are using with Arduino to have only a few hundred bytes or so of memory for some of the simple applications that it uses.
The register is going to be the only place where we are able to have logical-mathematical operations that we would like to carry out.
For example, if you would like to carry out an example of the addition of two variables, the value of these variables is something that we are going to need to move over to the register.
There are many benefits to working with the C language, and it is important that we learn how to use it properly.
It is similar to a lot of the work that we have done with the Arduino language, and we will look at a few of the different options that we are able to do with it along the way in this guidebook as well.
Before we dive into that though, we need to take a look at some more of the basics that will come with this language, and in particular, we are going to take a look at a concept that is known as the memory maps and how this is going to help C get the most out of our Arduino boards.