Skip to content

Instantly share code, notes, and snippets.

@ii0
Forked from philippbosch/sprintf.ino
Created January 17, 2019 07:32
Show Gist options
  • Save ii0/b4f4e687cf9af268bb74220347635701 to your computer and use it in GitHub Desktop.
Save ii0/b4f4e687cf9af268bb74220347635701 to your computer and use it in GitHub Desktop.
sprintf() in Arduino code
unsigned int i = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
char buffer[50];
sprintf(buffer, "the current value is %d", i++);
Serial.println(buffer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment