Errors when creating a library using another library2019 Community Moderator ElectionArduino addition assignmentArduino error: does not name a type?where we upload IRremote.h fileHiding use of class inside a library“compiling error” FreeRTOS Arduino Library with Visual Studio 2015 and Visual Micro pluginReference to 'send_byte' is ambiguous,Arduino Balance library errorWhen i compile this it gives me ERROR, Arduino starterConnecting Sparkfun ESP8266 Thing to Azure IoT HubVS Code giving header errors for Arduino? Missing official header?

Is being socially reclusive okay for a graduate student?

The Key to the Door

What is "desert glass" and what does it do to the PCs?

Ultrafilters as a double dual

I can't die. Who am I?

ESPP--any reason not to go all in?

Remove object from array based on array of some property of that object

Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?

3.5% Interest Student Loan or use all of my savings on Tuition?

Why are special aircraft used for the carriers in the United States Navy?

Professor forcing me to attend a conference

Should I use HTTPS on a domain that will only be used for redirection?

Create chunks from an array

Is there a way to find out the age of climbing ropes?

Is "cogitate" an appropriate word for this?

Split a number into equal parts given the number of parts

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

How do we objectively assess if a dialogue sounds unnatural or cringy?

What does it mean when I add a new variable to my linear model and the R^2 stays the same?

Who is at the mall?

Can you run a ground wire from stove directly to ground pole in the ground

Computing the volume of a simplex-like object with constraints

Linear Combination of Atomic Orbitals

Preparing as much as possible of a cake in advance



Errors when creating a library using another library



2019 Community Moderator ElectionArduino addition assignmentArduino error: does not name a type?where we upload IRremote.h fileHiding use of class inside a library“compiling error” FreeRTOS Arduino Library with Visual Studio 2015 and Visual Micro pluginReference to 'send_byte' is ambiguous,Arduino Balance library errorWhen i compile this it gives me ERROR, Arduino starterConnecting Sparkfun ESP8266 Thing to Azure IoT HubVS Code giving header errors for Arduino? Missing official header?










0















I am doing an IOT project and will be using various libraries for different sensors. I want to make a library for each hardware I am gonna make so that the main will only need a few lines of code to run. However, I have encountered few errors




firealarm.cpp:9:3: error: '((firealarm*)this)->firealarm::mq2' does not have class type



firealarm.cpp:13:9: error: '((firealarm*)this)->firealarm::mq2' does not have class type



firealarm.cpp:14:8: error: '((firealarm*)this)->firealarm::mq2' does not have class type



firealarm.cpp:15:11: error: '((firealarm*)this)->firealarm::mq2' does not have class type




Main file, which is called test2.0



#include "firealarm.h"

firealarm Falarm;

void setup()
firealarm.begin();


void loop()
firealarm.gas_values();



cpp file



#include "firealarm.h"
firealarm::firealarm()
MQ2 mq2(14);

void firealarm::begin(int baudrate)

Serial.begin(baudrate);
Serial.println("Firealarm libary created successfully");
mq2.begin();

void firealarm::gas_values()
float* values = MQ2.read(true);
lpg = mq2.readLPG();
co = mq2.readCO();
smoke = mq2.readSmoke();




h file



#include <MQ2.h>

#ifndef _firealarm
#define _firealarm

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

class firealarm
public:
firealarm();
void begin(int baudrate = 9600);
void gas_values();

MQ2 mq2(int pin);

int lpg, co, smoke;
private:

;
#endif









share|improve this question









New contributor




wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    0















    I am doing an IOT project and will be using various libraries for different sensors. I want to make a library for each hardware I am gonna make so that the main will only need a few lines of code to run. However, I have encountered few errors




    firealarm.cpp:9:3: error: '((firealarm*)this)->firealarm::mq2' does not have class type



    firealarm.cpp:13:9: error: '((firealarm*)this)->firealarm::mq2' does not have class type



    firealarm.cpp:14:8: error: '((firealarm*)this)->firealarm::mq2' does not have class type



    firealarm.cpp:15:11: error: '((firealarm*)this)->firealarm::mq2' does not have class type




    Main file, which is called test2.0



    #include "firealarm.h"

    firealarm Falarm;

    void setup()
    firealarm.begin();


    void loop()
    firealarm.gas_values();



    cpp file



    #include "firealarm.h"
    firealarm::firealarm()
    MQ2 mq2(14);

    void firealarm::begin(int baudrate)

    Serial.begin(baudrate);
    Serial.println("Firealarm libary created successfully");
    mq2.begin();

    void firealarm::gas_values()
    float* values = MQ2.read(true);
    lpg = mq2.readLPG();
    co = mq2.readCO();
    smoke = mq2.readSmoke();




    h file



    #include <MQ2.h>

    #ifndef _firealarm
    #define _firealarm

    #if ARDUINO >= 100
    #include "Arduino.h"
    #else
    #include "WProgram.h"
    #endif

    class firealarm
    public:
    firealarm();
    void begin(int baudrate = 9600);
    void gas_values();

    MQ2 mq2(int pin);

    int lpg, co, smoke;
    private:

    ;
    #endif









    share|improve this question









    New contributor




    wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      I am doing an IOT project and will be using various libraries for different sensors. I want to make a library for each hardware I am gonna make so that the main will only need a few lines of code to run. However, I have encountered few errors




      firealarm.cpp:9:3: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:13:9: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:14:8: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:15:11: error: '((firealarm*)this)->firealarm::mq2' does not have class type




      Main file, which is called test2.0



      #include "firealarm.h"

      firealarm Falarm;

      void setup()
      firealarm.begin();


      void loop()
      firealarm.gas_values();



      cpp file



      #include "firealarm.h"
      firealarm::firealarm()
      MQ2 mq2(14);

      void firealarm::begin(int baudrate)

      Serial.begin(baudrate);
      Serial.println("Firealarm libary created successfully");
      mq2.begin();

      void firealarm::gas_values()
      float* values = MQ2.read(true);
      lpg = mq2.readLPG();
      co = mq2.readCO();
      smoke = mq2.readSmoke();




      h file



      #include <MQ2.h>

      #ifndef _firealarm
      #define _firealarm

      #if ARDUINO >= 100
      #include "Arduino.h"
      #else
      #include "WProgram.h"
      #endif

      class firealarm
      public:
      firealarm();
      void begin(int baudrate = 9600);
      void gas_values();

      MQ2 mq2(int pin);

      int lpg, co, smoke;
      private:

      ;
      #endif









      share|improve this question









      New contributor




      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am doing an IOT project and will be using various libraries for different sensors. I want to make a library for each hardware I am gonna make so that the main will only need a few lines of code to run. However, I have encountered few errors




      firealarm.cpp:9:3: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:13:9: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:14:8: error: '((firealarm*)this)->firealarm::mq2' does not have class type



      firealarm.cpp:15:11: error: '((firealarm*)this)->firealarm::mq2' does not have class type




      Main file, which is called test2.0



      #include "firealarm.h"

      firealarm Falarm;

      void setup()
      firealarm.begin();


      void loop()
      firealarm.gas_values();



      cpp file



      #include "firealarm.h"
      firealarm::firealarm()
      MQ2 mq2(14);

      void firealarm::begin(int baudrate)

      Serial.begin(baudrate);
      Serial.println("Firealarm libary created successfully");
      mq2.begin();

      void firealarm::gas_values()
      float* values = MQ2.read(true);
      lpg = mq2.readLPG();
      co = mq2.readCO();
      smoke = mq2.readSmoke();




      h file



      #include <MQ2.h>

      #ifndef _firealarm
      #define _firealarm

      #if ARDUINO >= 100
      #include "Arduino.h"
      #else
      #include "WProgram.h"
      #endif

      class firealarm
      public:
      firealarm();
      void begin(int baudrate = 9600);
      void gas_values();

      MQ2 mq2(int pin);

      int lpg, co, smoke;
      private:

      ;
      #endif






      arduino






      share|improve this question









      New contributor




      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited yesterday







      wan













      New contributor




      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      wanwan

      11




      11




      New contributor




      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      wan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          wan is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023043%2ferrors-when-creating-a-library-using-another-library%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          wan is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          wan is a new contributor. Be nice, and check out our Code of Conduct.












          wan is a new contributor. Be nice, and check out our Code of Conduct.











          wan is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023043%2ferrors-when-creating-a-library-using-another-library%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite