I'm having some difficulty using class in arduino code.
I'm experienced with classes in Processing or Java but haven't used C++ for many times. I just want to define a class and use it in my arduino code. Here is my code. It won't compile :error: expected initializer before 'potato'. Can someone point out what I did wrong and the right way to do it? Thanks.
class stuff
{
public:
int name;
stuff(int n)
{
name=n;
}
void run()
{
// do something
}
}
stuff potato=stuff(2);
void setup()
{
}
void loop()
{
}