Arduino programming is primarily based on C/C++. Here's a breakdown of how it works:
### **1. Core Language**
- **C/C++ Syntax**: The Arduino language is based on C/C++ syntax. This means that most of the syntax, operators, and general structure of the code follow C/C++ rules. You use similar constructs like variables, functions, loops, and conditionals as you would in C or C++.
### **2. Arduino IDE and Abstractions**
- **Simplified Interface**: The Arduino Integrated Development Environment (IDE) provides a simplified interface for writing and uploading code to the Arduino board. It abstracts some of the more complex parts of C/C++, making it more accessible, especially for beginners.
- **Arduino Functions**: The Arduino environment includes specific libraries and functions (e.g., `digitalWrite()`, `analogRead()`, `delay()`) that are part of the Arduino core library. These functions are written in C/C++ but are simplified for easier use.
### **3. Compilation**
- **Preprocessing**: When you write an Arduino sketch, the IDE preprocesses the code before compiling it. This includes automatically adding function prototypes and including necessary libraries. The preprocessed code is then compiled using a C/C++ compiler (like GCC).
- **C++ Features**: While Arduino sketches can be written in a style that is very similar to C, they can also make use of C++ features such as classes and object-oriented programming. This means you can use C++ libraries and practices in your Arduino projects if desired.
### **Summary**
In essence, Arduino programming is a practical application of C/C++ with some added convenience functions and libraries specific to the Arduino platform. If you're familiar with C or C++, you'll find Arduino programming quite straightforward, but the platform also provides simplified tools and abstractions to help beginners get started.