Examples - HowTo - Simple Class

A simple class in wiring

This Code Snippet shows the use of classes in Wiring.



//
// A Simple Class
// by Etienne Ribeiro, Christoph Wartmann
// 3 Februar 2009
//



//
// demo

class demo {

        public:
        int increase(int i) {
                return ++i;
        }

};




//
// Setup

void setup(){

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


        // Start Serial
        Serial.begin(9600);


        // Class
        demo xy;
        int x2 = xy.increase (4);


        //
        Serial.println (x2);

}



//
// Loop

void loop () {

}

This website has been archived and is no longer maintained.