Arduino uses a language that is based on C and C++. This language, often referred to simply as "Arduino," is a simplified version of C/C++ designed to make programming easier for beginners. Here are some key features:
1. **Simplified Syntax**: While it’s based on C/C++, Arduino has simplified syntax and function calls to make programming more accessible. It hides some of the complexity of C/C++.
2. **Predefined Functions**: Arduino includes a set of predefined functions such as `setup()` and `loop()`, which are required for every Arduino program. `setup()` runs once when the program starts, and `loop()` runs continuously.
3. **Library Support**: The Arduino environment provides a range of libraries to simplify tasks like controlling hardware (e.g., motors, LEDs), communication (e.g., serial communication, networking), and interfacing with various sensors.
4. **Integrated Development Environment (IDE)**: Arduino provides its own IDE, which includes an editor for writing code, a compiler, and a means to upload code to the Arduino board.
5. **Hardware Abstraction**: The Arduino language abstracts hardware interactions, so you can use simple commands to control hardware components without needing to write complex code.
Here’s a basic example of an Arduino sketch (program):
```cpp
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED pin as an output
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
```
In this example, `setup()` initializes the built-in LED as an output, and `loop()` continuously turns the LED on and off every second.