I see a few things that might help:
- Make sure you put a semicolon ';' after the final '}' in the class declaration.
- you will need to make some things "public" if you access them from outside the class. By default, members of a class are "private".
- You should declare variables as members of the class if they are part of the object.
Here is an example of what I mean:
class OneWireLib
{
public:
OneWireLib()
{
int y =1; // this 'y' will go away once the constructor returns (it is a local variable)
somevar = 99; // initialize class member variables here in the constructor
}
void ConvertTemp()
{
int x =1;
}
int GetSomeVar() // example of method for using private data
{
return somevar;
}
private:
int somevar; // put variables that are part of the object here
}; // <=== note semicolon here... terminates the class declaration
OneWireLib onewire; // declare an instance of the OneWireLib class
void setup()
{
int x = onewire.GetSomeVar(); // example of calling a class method
}