Arduino

Image
Arduino

What is Arduino IDE?

  • Arduino IDE (Integrated Development Environment) is the official software used to write, compile, and upload programs (called sketches) to dev boards.
  • It provides an editor, compiler (based on avr-gcc for AVR boards), and uploader (via avrdude).

Can I use another compiler for dev boards?

  • Yes You can use alternatives like:
    • PlatformIO (VS Code extension, more powerful)
    • Atmel Studio / Microchip Studio
    • Arduino CLI (command-line tool)
    • Even plain avr-gcc + avrdude without Arduino IDE.

How to write a code in IDE?

  • Arduino code = C/C++ simplified with libraries.
  • A basic program has two main functions: void setup() { // Runs once at start } void loop() { // Runs continuously }

What is the minimum bare code of Arduino?

  • The smallest valid Arduino sketch is: void setup() {} void loop() {}
  • This compiles to a very small binary (few hundred bytes).

How to connect the Dev board to PC?

  • Use a USB cable (depends on board: Type-A to Type-B for UNO, Micro-USB or USB-C for newer boards).
  • It powers the board and provides serial communication.

Connection the Dev board with IDE?

  1. Open IDE → Tools → Board → Select your Dev model
  2. Go to Tools → Port → Select COMx (Windows) / /dev/ttyUSBx (Linux/Mac)

How to compile the code in IDE?

  • Click the ✔ Verify button (top-left).
  • IDE uses avr-gcc (for UNO/Nano) or appropriate compiler for your board.

What is the compiled output file type?

  • After compilation, ArduinoIDE generates:
    • .hex file (Intel HEX format → uploaded to MCU flash)
    • Sometimes a .elf file (Executable and Linkable Format, with debug info).

Where is my compiler binary code stored in PC?

  • Compiled files are stored in a temporary build folder.
    • Windows: C:\Users\<username>\AppData\Local\Temp\arduino_build_xxxxx
    • Linux: /tmp/arduino_build_xxxxx
    • Mac: /var/folders/.../arduino_build_xxxxx

How to upload the code to dev board?

  • Click the ➡ Upload button in IDE.
  • uses avrdude (for AVR boards) to send .hex file via USB serial bootloader.

How to manually upload the binary file into dev board?

Two ways:

(a) Using avrdude (bootloader method):

avrdude -c arduino -p atmega328p -P COM3 -b 115200 -U flash:w:sketch.hex:i

(b) Using an ISP Programmer (if bootloader is erased/corrupted):

  • Use the USBasp or Atmel ICE or another Arduino as ISP.
  • Burn .hex directly into flash memory.

All Topics

Arduino-Get Start
Arduino Interface
Arduino Interface-LED
Arduino Interface-Button
Arduino Interface -Buzzer
Arduino Interface-ADC
Arduino Interface-UART(Serial)
Arduino Interface-PWM
Arduino Interface-RGB LED
Arduino Interface-LCD
Arduino Tutorials
Random Number Generator
Voltage Measurement
Arduino Projects
Therimine
Water Flow Meter
Servo Control Using Accelerometer ADXL345
Others
Arduino-Course
Arduino-Sitemap
Arduino-FAQ

 


 

Please turn AdBlock off, and continue learning

Notice for AdBlock users

Please turn AdBlock off
Index