Skip to content

Instantly share code, notes, and snippets.

@matthijskooijman
Forked from amcjen/gist:9573550
Last active August 29, 2015 13:57
Show Gist options
  • Save matthijskooijman/9575651 to your computer and use it in GitHub Desktop.
Save matthijskooijman/9575651 to your computer and use it in GitHub Desktop.
#include <SPI.h>
#include <Wire.h>
#include <Scout.h>
#include <GS.h>
#include <bitlash.h>
#include <lwm.h>
#include <js0n.h>
#include "util/StringBuffer.h"
#include "util/PrintToString.h"
StringBuffer str(0, 4);
void setup() {
Serial.begin(115200);
str = "{";
Serial.println(str);
str += "ab";
str += "d";
str += "e";
Serial.println(str);
str.appendSprintf("\"%s\": %d", "hi", 2);
Serial.println(str);
str.appendSprintf(", \"%s\": %d", "key", 3);
Serial.println(str);
str += "}";
PrintToString pts(str);
pts.println();
pts.println("one more line");
Serial.println(str);
printToString<&str>('m');
printToString<&str>('o');
printToString<&str>('r');
printToString<&str>('e');
Serial.println(str);
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment