Classes and objects inside them that can be used my all members of a class

Hello all,

I made a library and I am trying to call a pre-existing library. The PID_1v library is the one being called from inside my library. I would just post my code as it would show the problem better, but its for a engineering competition and I am not supposed to post the code and stuff like that. How does one go about using something like the PID library, construct it, and make it usable to all of my class?

#include "myLib.h"

myLib lib;
void setup(){

}

void loop(){
    lib.myLibUpdate();
}
#ifndef MYLIB_H
#define MYLIB_H

class
{
   private:
             int myVar;
   public:
             myLib();
             myLibUpdate();
};
#endif
#include "myLib.h"
#include "PID.h"

myLib::myLib()
{
   PID myPID(input,output,value,kp,ki,kd,DIRECT); // This is what I am trying and its not working
}


myLib::myLibUpdate()
{
   myPID.compute();
}

// This is what I am trying and its not working

How to use this forum

What error message did you get?

Your class code is not valid, it needs a name, and only constructors and destructors have no return type. Everything else is marked with a type, functions that do not return data use the type ‘void’

#ifndef MYLIB_H
#define MYLIB_H

class myLib
{
   private:
             int myVar;
   public:
             myLib();
             void myLibUpdate();
};
#endif
#include "myLib.h"
#include "PID.h"

myLib::myLib()
{
   PID myPID(input,output,value,kp,ki,kd,DIRECT); // This is what I am trying and its not working
}


void myLib::myLibUpdate()
{
   myPID.compute();
}

Also, if PID is a separate library, use #include <PID.h> and place it in your sketch file too.

WylieSt: This is what I am trying and its not working

What are the symptoms of it 'not working'?

There are various faults that prevent your example code from compiling so it's hard to guess which of these problems you're referring to.