This topic has 2 replies, 2 voices, and was last updated 10 months, 2 weeks ago by AngoLito.

  • Author
    Posts
  • #22766
     AngoLito
    Member

    My Achievements

    Create a new Forum Topic IconPlease Reply/Comment on An Update IconRegister at STEMpedia Website IconFirst Login Icon

    Hello,

    I just received Evive; I’m trying some functions and “playing” with it.

    I’m not be able to add exemple Clock sketch as third user function. I followed steps on https://thestempedia.com/docs/evive/menu-interface/user-defined-functions/  copying partial Setup (my Clock are already adjusted), copying loop part, declaring object Rtc_Pcf8563 rtc; (as line 11 on Clock example) but when compiling I received this error: “AddUserDefinedFunctions.cpp:95: error: ‘rtc’ was not declared in this scope”

    I’ve tried to manually include RTC library “#include <Rtc_Pcf8563.h>” but then, I receive a thousands of errors about multiple definitions

    Last two hours I’m trying and trying and I do not understand what I’m doing wrong. Please, any sugestion?

    I attach Arduino sketch If someoine want to test…

    Oh! I’m using MAC OSX 10.12.6, tested under Arduino 1.8.3 and 1.8.5 versions

    Thanks for your time…

     

    #22795
     Pankaj Verma
    Keymaster

    My Achievements

    Completed first Lesson IconPassed a Quiz IconFirst Login Icon

    Hi,

    I have solved your problem. When you are adding program into the user-defined function, you also have to declare the variables and objects used in the setup and loop part. Since initially, you didn’t include the definition of the object, that’s why you got the error.

    On the second try, you included the RTC library, but it is already included in the evive library.

    I have attached the correct code. You can take it as the reference and test it out.

    Happy Tinkering

     

    #22798
     AngoLito
    Member

    My Achievements

    Create a new Forum Topic IconPlease Reply/Comment on An Update IconRegister at STEMpedia Website IconFirst Login Icon

    Hello Pankaj,

    Thank you very much for your answer and your time; sorry but it seems attached file has not any changes for a clock add on user defionions menu… there is no reference on code, it seems just the extended firmaware code included at library.

    Really I have tested to declare rtc object on many places because it was not working (I started to doubt where declare rtc object with sentence: “Rtc_Pcf8563 rtc;”

    Some of my attemps to declare rtc object on code I sent on my previous mail:

    A) At line 71 of <addUserDefinedFunctions.cpp>  at setup user_def_fun_3() section. Error ‘Rtc_Pcf8563 was not declared in this scope’

     

    B) At same line 71 and includding library #include “Rtc_Pcf8563.h” at line 34 of same <addUserDefinedFunctions.cpp>; knowing this library are already on evive.h…but doing a try error test.

    Error ‘Rtc_Pcf8563 was not declared in this scope’

     

    C) At line 35 and adding #include “Rtc_Pc8563.h” at line 34 of same <addUserDefinedFunctions.cpp>

    Error compiling to Arduino/Genuino Mega or Mega 2560

     

    D) Writing Rtc_Pcf8563 rtc; at line 45 of <addUserDefinedFunctions.h> (I doubt if this kind of declarations must be placed on .cpp sketch or in .h)

    Error ‘Rtc_Pcf8563’ does not name a type

     

    E) Writing Rtc_Pcf8563 rtc; at line 45 of <addUserDefinedFunctions.h> and also including #include “Rtc_Pcf8563.h” at line 44 of same .h sketch

    Error compiling to Arduino/Genuino Mega or Mega 2560

    And some more test in others sketchs… (action, screenimplementation…)

    Please; can you check your right working file and send me? I’m very curious what I’m doing wrong

    I’m working on a sketch with RTC; a new clock with alarm, and mode to set parameters and works fine (I’m not attempting to include, by now, at User definited functions) but I would like to include on a future.

    I also I’m thinking of chrono file controled by pins to measure times, events…

    When I finish I will share code…

     

    Best regards!

    Manuel

     

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Log in with your credentials

or    

Forgot your details?

Create Account