Skip to content

Instantly share code, notes, and snippets.

@shevkoplyas
shevkoplyas / aprintf
Last active August 29, 2015 14:10 — forked from EleotleCram/aprintf
int aprintf(char *str, ...) {
int i, j, count = 0;
va_list argv;
va_start(argv, str);
for(i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] == '%') {
count++;
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j);