Pinguino Forum

Full Version: sprintf does not compile, printf does not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Consider the following code (v11 PIC18F4550 v4.0)
int num = 100;

void setup()
    pinMode(USERLED, OUTPUT);   

void loop()
   char tmp[64];
   // Serial.printf("i = %i\n", num);
    toggle(USERLED);    // alternate ON and OFF
The sprintf line does not compile and the printf (commented out prints only "i=". What's wrong?
You have to write 
instead of

Look into p8\pdl\pinguino.pdl file line 26
Sprintf psprintf#include <stdio.c>

that means Sprintf (....) is replaced by psprintf(....), defined in stdio.c ,located in p8\include\pinguino\core.

PS :if you use version 12 it is true too but the replacement of Sprintf may be different.