C Basics and the Arduino

The Arduino microcontroller has its own language which is similar to C++ and C.

It has a limited memory space so certain things like arrays will be limited. Arrays are a more advanced concept in programming but when you get to that point you may need to go to a more advanced board like a full computer Rasberry Pi.

But for now since the language used on the Arduino looks a lot like C, lets talk about how to program in C.

The C language is one of the most popular and powerful languages used in Robotics so it is certainly at least being familiar with how it looks.

The other languages are Python which can be used on the Raspberry Pi board and a version of C called C++ which leads into a topic called object oriented programming.

Now when you look at C source code, you will see a lot of symbols like “;”… “{ “… and “} surrounding a handful of lines of code and some small brackets with words like void() and setup().

Making a program is like making a recipe to make a a cake.

You have ingredients called variables…and you do a little bit of set up with certain tools and you do some actions or functions over and over again (loops like if and while) until the reciple is finished.

The word library comes up all the time and it simply means that C has a lot of prewritten code in libraries that you simply bring into your program to make it easier.

Its like accessing recipe books from the shelf when you need them and you would use the “#include stdio” word to include the library files in your program at the top of the program.

Almost every computer book on C or C++ will have you write the worlds simplest program to print out the words “hello world” in a window.

This program is not used on an Arduino because it does not create a window on the screen to print out “hello world” but you may add some kind of display to the board to do this.