Adventures in Science: Arduino Programming Syntax

This week, we look at what constitutes syntax in a programming language and how to employ it when writing code in Arduino.

Favorited Favorite 0

Last week, we examined how a program flows in Arduino. This week, we continue with the computer science theme and look at syntax rules: What do we mean by syntax in programming, and how do we use it when writing for Arduino?

Syntax, as it relates to computer science, is the set of rules for combining words, phrases, numbers and symbols to create correctly structured code in a programming language. In the video, we look at how high-level languages like C and C++ came to be, what makes up identifiers, and some keywords to avoid using as identifiers. We also examine single line (//) and multiple line (/* */) comments and how they can be used to document code.

Many of the reserved keywords and built-in Arduino functions can be found on Arduino's reference page, which has proven to be an invaluable resource when teaching people the building blocks of Arduino.

If you're new to Arduino but have some experience programming, this tutorial might be able to shed some light on what this Arduino thing is:

What is an Arduino?

February 26, 2013

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

What other computer science concepts would you like to see covered? Please let us know in the comments below.

I'm hoping to cover the basics for students and beginners. Time permitting, I would love to get around to more advanced topics like PWM, interrupts and writing your own Arduino libraries using object-oriented programming.


Comments 4 comments

  • sgrace / about 8 years ago / 1

    I want to add a comment related to learning other languages. Learning coding languages is like learning a foreign language, you have to learn the RULES of the language to understand how to format your phrases. Same thing with the syntax of a coding language. If you start off with C/C++ based syntax, learn all of the languages that are similar in syntax!

    For example, you are learning C/C++, and now you are wanting to go to FPGAs, your logical step should be to Verilog/SystemVerilog. This is because it syntactically similar to C/C++.

    Just my 2 cents.

    • Good tip, thanks! This seems to hold true when learning any new paradigm, like object oriented programming.

Related Posts

Recent Posts

Halloween Hacking

SparkFun Spooktacular

Tags


All Tags