I would like to know where I can see the output when I use the command printf. I am programming using the Arduino interface.


I'll add a few lines of code for better understanding:

#include <stdio.h>

int main(void)
    printf("Hello World");

    return 0;
  • your goal is to print something out in your console of the Arduino IDE?
    – letsjak
    Dec 15 '14 at 14:10
  • there is no main in Arduino. You have the setup for initialization and the loop for the continuing loop
    – letsjak
    Dec 15 '14 at 14:20
  • 2
    @letsjak there is a main in Arduino, but it is hidden seeedstudio.com/wiki/Where_is_Main_Function Dec 15 '14 at 14:29

If you're working with the standard Arduino environment and libraries then printf() won't display anything anywhere. The reason is that microcontrollers could be connected to any number of different output/communication devices in any way. stdio would have no idea how or where to send the data.

The most common approach to outputting text from an Arduino (particularly during development) is to send it to the primary UART port using Serial.begin() and Serial.print(). If the Arduino is connected to your computer via USB then the Arduino IDE's serial monitor should display the result.

If you really want to use printf() though then it is possible to make it work (or implement similar functionality). A full explanation is on this page:


In setup(), start serial and choose your speed:


Wherever you want to write to serial:

Serial.write("write this");

Wherever you want a newline:



void setup() {
  // put your setup code here, to run once:
  Serial.write("Hello World");


void loop() {
  // put your main code here, to run repeatedly:

  • my question is actually where am I printing if I don't define Serial in void setup() and just type printf in void loop()? Dec 15 '14 at 14:42
  • @ironzionlion if you read the printf documentation.. you will find it...
    – letsjak
    Dec 15 '14 at 15:26
  • @ironzionlion it's an LCD... tadaaaaaaa playground.arduino.cc/Main/Printf
    – letsjak
    Dec 15 '14 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.