Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [printf]

The tag has no usage guidance.

1
vote
1answer
60 views

How to use a variable format in `sprintf`

How should I make a variable format sequence for sprintf?. int i=2,d=9; String sf; sprintf(sf,"%%0%d",i); fprintf(sf,d); While expecting the output. 09 The compilation fails, with several errors, ...
0
votes
2answers
88 views

Porting the FastNoise c++ library to Due

I'm trying to use the FastNoise library with a Due, however, I get something like the following errors, when I try to complie. error: 'abs' was not declared in this scope error: 'mt19937' is not a ...
0
votes
1answer
1k views

Serial printf implementation

Based on this approach I wanted to implement a function for formatted printing data to the serial monitor. I tried the code below: int PIN = 12; void _printf(char *fmt, ...) { va_list va; ...
0
votes
2answers
2k views

formatting of IPAddress via printf(…) family similar to Serial Object

I am trying to use an sprintf with an IPAddress and I am not sure why Serial.print() is able to convert IPAddress to a reasonable human readable representation. I mean, presumably it uses an ...
2
votes
1answer
5k views

Using pointers with Arduino

I am learning about pointers. I was wondering how the memory address is defined in programming. I get different outputs depending on the format I choose for memory address. So I was wondering if it ...
0
votes
2answers
244 views

Using the Logging library, sometimes doesn't exit setup()

This has been a hard problem to diagnose, so I hope I'm giving enough info here. I'm trying to write a program for the Arduino (a lighting controller) using a bit of OO. There are several classes in ...
-1
votes
1answer
188 views

AVR has no vprintf_P?

Well this was unexpected. AVR libc has many the variants of printf, including vprintf, but is missing vprintf_P. Is this really just not present or implemented elsewhere?
3
votes
1answer
853 views

How to use printf with Arduino's serial ports without an intermediary buffer?

How to use printf with Arduino's streams without an intermediary buffer? The following seems unnecessary: char buf[256]; sprintf(buf, ...); Serial.print(buf); Is there a way to connect ...