Type Here to Get Search Results !

How To Add Comments In Your Arduino Code

The last subject I would like to cover is related to adding comments in our code. now, comment are used to document what’s going on in a program for anyone reading the code, and should be used any time we wish to explain what a program or maybe a specific function is supposed to do.


Feel free to use them throughout your sketch even if you think that they are not useful right now be sure, they will help you to understand "what the hell"  have you done like just like a week or month ago in your sketch. They are also useful for disabling parts of a sketch for testing and debugging

We can quickly disable specific line or group of lines and see what happens. It’s also helpful to make a change in a part of the code but leave the old code in place using comments just in case we want use that old code again.

Now, there are two basic types of comments:


  1. Single-line and multi-line
  2. For single-line comment we use the symbols with double forward slash //
  3. For multiline comment the lines are enclosed within the following symbols /* and */.
  4. They are used to mark the beginning and the end of that block of comments.

OK, This is very simple and very useful to be used in your sketch. ok, that's all for this section, we covered many subjects and now we would like to start practice some of of them while creating our first project. Please watch this practical demonstration below.



Post a Comment

0 Comments