Logo home 9

Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
Embedded IoT Solutions

Which Programming Language Does Arduino Use?

Category
Embedded IoT Solutions
Read Time
6 min read
Published
November 21, 2019
Status
Published

Arduino uses C++, but what you write does not look like the C++ a desktop developer knows. Here is what the framework adds, hides, and eventually costs you.

Arduino uses C++. That is the short answer, and it is slightly misleading, because what you write in the Arduino IDE does not look much like the C++ a desktop developer would recognise.

Arduino sketches are C++ with a simplified structure, a large library of helper functions, and a build process that hides the parts beginners find discouraging. The result feels like its own language, which is exactly the point — and it is also why developers eventually hit limits and need to know what is underneath.

This guide explains what the Arduino language really is, what the framework adds and hides, where its abstractions become a problem, and which languages work as alternatives.

The Answer

What the Arduino Language Actually Is

An Arduino sketch is compiled by avr-gcc or arm-gcc as C++. Before compilation the toolchain performs a few conveniences:

  • Adds #include <Arduino.h> so the core library is available without you asking
  • Generates function prototypes automatically, so functions can be used before they are declared
  • Wraps your setup() and loop() in a real main() that calls them
  • Links the core library that implements digitalWrite, analogRead, Serial and the rest

Everything valid in C++ is valid in a sketch: classes, templates, references, standard containers where memory allows. You can also drop straight to C, or to direct register access, in the middle of a sketch.

There is no “Arduino language”. There is C++ with the awkward parts pre-arranged.

Structure

Why setup() and loop() Instead of main()

Standard C++ starts at main() and ends when it returns. Embedded firmware never ends — it initialises once, then runs forever. Arduino encodes that reality in its structure:

  • setup() runs once at power-up: configure pins, start Serial, initialise sensors.
  • loop() runs repeatedly and immediately restarts when it finishes.

Behind the scenes, the generated main() calls setup() once, then loop() inside an infinite loop. Beginners get the correct embedded program shape without having to be told why.

Trade-offs

What the Abstraction Costs

The convenience is real, and so is the price. These matter once a project grows beyond a prototype.

Arduino wayWhat it hidesWhen it becomes a problem
digitalWrite()Pin lookup tables and port manipulationTens of times slower than direct register writes; matters in tight timing loops
delay()A blocking busy-waitNothing else can run; the first thing to outgrow in any real product
analogRead()ADC configuration and timingNo control over sampling rate, reference, or averaging
Automatic main()Startup and initialisation orderHarder to control low-power startup behaviour
Core library always linkedFlash and RAM overheadTight on very small microcontrollers
No RTOS by defaultTask schedulingConcurrency must be hand-rolled with state machines

The practical milestone for most developers is replacing delay() with timing based on millis(), because a blocking delay makes it impossible to do two things at once. That single change is the usual step from sketch to firmware.

Alternatives

Other Languages for Arduino-Class Hardware

C
Still the standard for professional firmware. Smaller and more predictable than C++ with libraries, and the language most vendor SDKs are written in.
MicroPython and CircuitPython
Excellent for rapid prototyping and teaching on ESP32 or RP2040-class boards. Slower and far more memory-hungry, so rarely suitable for production on constrained parts.
Rust
Growing steadily in embedded for its memory safety guarantees without a garbage collector. Tooling is maturing and the learning curve is real, but it is a serious option for new firmware.
Vendor SDKs in C
ESP-IDF for ESP32 or the Nordic SDK for nRF parts expose the full capability of the chip, including power modes and radio features the Arduino core abstracts away.
An RTOS such as Zephyr
Still C or C++, but with real task scheduling, drivers and connectivity stacks — the usual destination for products that outgrow the Arduino model.
Practice

Using Arduino Well, and Knowing When to Leave

1Replace delay() early
Use millis()-based timing so the loop stays responsive. This is the difference between a demo and something that can do more than one thing.
2Drop to registers only where measured
Direct port manipulation is much faster but harder to read and not portable. Use it where timing demands it, not everywhere.
3Watch RAM, not just flash
String objects and dynamic allocation fragment small heaps and cause mysterious late failures. Prefer fixed buffers and F() for constant strings on AVR parts.
4Treat libraries as dependencies
Pin versions and read the source of anything in your critical path. Library quality varies enormously, and an unmaintained library becomes your maintenance problem.
5Know the exit criteria
Move to a vendor SDK or an RTOS when you need deep sleep and precise power control, certified connectivity stacks, secure boot and OTA, or real task scheduling.
6Prototype in Arduino regardless
Even teams who will ship on an RTOS often validate sensors and concepts in Arduino first, because it is the fastest way to find out whether the physics works.

That last point is worth keeping: proving the signal exists before committing to hardware is a core step in building an IoT product, and Arduino remains one of the quickest ways to do it.

FAQ

Frequently Asked Questions

Which programming language does Arduino use?
C++. Sketches are compiled as C++ by avr-gcc or arm-gcc, with the toolchain adding the Arduino core header, generating function prototypes, and wrapping setup() and loop() inside a generated main(). There is no separate Arduino language.
Is Arduino C or C++?
C++, though plain C code compiles fine inside a sketch. You can use classes, templates and references, and you can also drop to direct register access when you need speed or control the core library does not expose.
Why does Arduino use setup() and loop() instead of main()?
Because embedded firmware initialises once then runs forever. Arduino generates a main() that calls setup() once and loop() repeatedly, giving beginners the correct program structure for a microcontroller without having to explain it first.
Why is digitalWrite slow?
It performs pin lookups and safety checks on every call rather than writing straight to a port register, making it many times slower than direct register manipulation. It is irrelevant for blinking an LED and significant inside tight timing loops.
Can you use Python on Arduino-class boards?
MicroPython and CircuitPython run on ESP32, RP2040 and similar boards and are excellent for prototyping and teaching. They are considerably slower and use far more memory, so they are rarely the right choice for production on constrained hardware.
When should you move beyond the Arduino framework?
When you need deep sleep and fine power control, certified Bluetooth or Wi-Fi stacks, secure boot and OTA updates, or genuine task scheduling. At that point a vendor SDK such as ESP-IDF, or an RTOS such as Zephyr, gives access to what the Arduino core abstracts away.
Wrapping Up

Conclusion

Arduino uses C++, presented in a way that removes the obstacles that stop beginners. That abstraction is a genuine achievement and the reason an enormous number of engineers started here.

It is also a ceiling. Once a project needs precise timing, low power, certified connectivity, or secure updates, the right move is to keep the C++ knowledge and leave the framework behind — usually for a vendor SDK or an RTOS. Prototyping in Arduino first remains a sensible step regardless of where the product ends up.

About MetaDesk Global

Engineering the Next Generation of Connected Products

MetaDesk Global helps startups and enterprises develop intelligent connected products that combine embedded systems, Industrial IoT, Edge AI, and cloud technologies. Our expertise includes:

Industrial IoT (IIoT) Solutions Embedded Firmware Development Edge AI Development Predictive Maintenance Systems PCB Design IoT Gateway Development Cloud Integration OTA Firmware Updates AIoT Product Development End-to-End Product Engineering

From hardware design to AI-powered industrial platforms, we build scalable solutions for the next generation of connected products.

Start Your Project

Building a Connected Product?

We design IIoT sensor networks, Edge AI pipelines, and secure cloud platforms — from prototype to production.

Request a Free Quote →