Why can't I declare a class in another tab in Arduino IDE?
It is not possible to declare and use classes declared in one .pde file in another .pde file from within the Arduino IDE.

One workaround is to make the second file into a C++ source file (.cpp) and then add a #include "&lt;filename&gt;" directive in the beginning of the first file.



This code compiles correctly:

Tab 1:

#include "test.cpp"

TestClass obj;

void setup()
{
    obj.init();
}

void loop()
{
    //...
}


test.cpp :

class TestClass
{
public:
    void init()
    {
        //...
    }
};