How can I get access to the standard functions (like digitalWrite(), delay() etc. in another custom class?
If I could include these somehow?
these function calls in the main file (.pde) are not used through an instance either? ( xxx.delay() , so you have no option to send it to a constructor to make use of the basic functions in another class.
so Im wondering how can I use them in my own custom classes.
The other standard libraries can be included and used as I can see.
are these really only available in the main (pde) class ( the setup() loop() class) ?
HIGH is not a function. It is #defined in wiring.h, which is included by WProgram.h, which is included by the sketch automagically, but is not included in your class, but needs to be.
using namespace std;
class Blinker
{
public:
Blinker();
void Blink();
};
Blinker.cpp code..
#include "Blinker.h"
Blinker::Blinker()
{
}
void Blinker::Blink()
{
digitalWrite(13, HIGH); // set the LED on
delay(20*i); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(20*i); // wait for a second
}
I did not find any docs on were to find them (WProgram.h).
On windows, you can navigate to the folder where the Arduino IDE is installed, and open the search function. Type the name of the function/constant in the text field, and let the OS find the file for you. That's what I did.