Forum 2005-2010 (read only)
(Read 17766 times)
Sep 19, 2007, 02:00 am
Should I expect printf to work? If I include stdio.h programs compile without error but nothing is printed back to the ide.
int luckyNumber = 5;
float radius = 2;
char myName = "John";
char initial = 'J';
printf("My lucky number is %d\n", luckyNumber);
printf("My name is %s\n",myName);
printf("My first initial is %c\n",initial);
printf("The area of a circle with radius %f is %f\n", 3.14*radius*radius);
Sep 19, 2007, 04:49 pm
printf doesn't print to the serial port, it just prints to the "display" (of which, there is none on arduino).
If you want the power of printf, try using the
and then sending the result via Serial.print().
Hope that helps.