/**************************************************************************************************
*
*  StringBuilder
*
*   Version:      1.0.0 - Mai 2009
*   Author:       Etienne Ribeiro     / tutorial assistant caad      /  eribeiro[at]ethz.ch
*   Supervisor:   Christoph Wartmann  / chair for caad - ETH Zürich  /  wartmann[at].arch.ethz.ch
*
*   Desc:         Basic library to concate String/String, String/int, String/long and String/char.
*                 Wiring doesn't support "string1" + "string2" or "string" + number, so use this
*                 functions instead.
*
***************************************************************************************************/



// var
int onboardLED = 13; // 13 for Arduino, 48 for Wiring



// setup

void setup () {

        // LED (2 * blink)
        pinMode(onboardLED, OUTPUT);
        digitalWrite(onboardLED, HIGH);
        delay(200);
        digitalWrite(onboardLED, LOW);
        delay(200);
        digitalWrite(onboardLED, HIGH);


        // Serial
        Serial.begin (9600);
        Serial.println ("String Builder");


        // Test
        char strHello[40];
        BuildString (strHello, "Hello ", "Bill");
        Serial.println (strHello);
        BuildString (strHello, strHello, ". ");
        Serial.println (strHello);
        BuildString (strHello, strHello, (int) 4);
        Serial.println (strHello);
        BuildString (strHello, strHello, " plus ");
        Serial.println (strHello);
        BuildString (strHello, strHello, (long) 0);
        Serial.println (strHello);
        BuildString (strHello, strHello, " plus ");
        Serial.println (strHello);
        BuildString (strHello, strHello, (long) -2);
        Serial.println (strHello);
        BuildString (strHello, strHello, " makes ");
        Serial.println (strHello);
        BuildString (strHello, strHello, '2');
        Serial.println (strHello);

}




// loop

void loop () {



}





This website has been archived and is no longer maintained.