// Led.h - Library header for blinking LED class. // In this file you declare all the methods and variables your class is using. // By Hannes Oswald at CAAD Arch EtHZ, 04.02.2009 // Created for learning purposes /* .h - files are header files. Note that constructor function (here called Led) do not have a return value. _var is a convention to visualize private variables. */ #ifndef Led_h // good way to avoid defining the function twice #define Led_h // good way to avoid defining the function twice #include "WProgram.h" // necessary line. basic functions that usually arduino code appends automaticaly class Led { public: // public functions and vars can be accessed by other parts of the script Led(int pin); void blink(int times, int duration); private: // private functions and vars can only be used by the class and its methods itself int _pin; // use _ in front of names as a convention to make clear what is private }; #endif // good way to avoid defining the function twice