Relay with button



  • Does anyone have an updates sketch for the relay with button that works on the current library?


  • Hero Member

    Have you checked from GitHub?

    Updated examples allong with some external librarys are available from here -> https://github.com/mysensors/MySensorsArduinoExamples

    Relay with button sketch is here -> https://github.com/mysensors/MySensorsArduinoExamples/tree/master/examples/RelayWithButtonActuator



  • Hi, thanks for the reply, by the looks of it this is the same sketch on the my sensors site, unfortunately it doesn't seem to work on the new library, unless that is just me doing something retarded.


  • Hero Member

    @Lanman said:

    doesn't seem to work

    Can you elaborate on this? What is it that is not working? Can you get the serial debug output from your node?

    // Enable debug prints
    #define MY_DEBUG
    


  • It won't even upload to the arduino,

    It works if you use the old library but on v 2.0 this is the result.

    C:\Users\Shane\AppData\Local\Temp\ccwaR9Zf.ltrans2.ltrans.o: In function `loop':

    ccwaR9Zf.ltrans2.o:(.text+0x8): undefined reference to `Bounce::update()'

    ccwaR9Zf.ltrans2.o:(.text+0x10): undefined reference to `Bounce::read()'

    C:\Users\Shane\AppData\Local\Temp\ccwaR9Zf.ltrans2.ltrans.o: In function `setup':

    ccwaR9Zf.ltrans2.o:(.text+0x9e): undefined reference to `Bounce::attach(int)'

    ccwaR9Zf.ltrans2.o:(.text+0xaa): undefined reference to `Bounce::interval(unsigned int)'

    C:\Users\Shane\AppData\Local\Temp\ccwaR9Zf.ltrans3.ltrans.o: In function `global constructors keyed to 65535_0_relay_button1.ino.cpp.o.2246':

    ccwaR9Zf.ltrans3.o:(.text.startup+0x64): undefined reference to `Bounce::Bounce()'

    collect2.exe: error: ld returned 1 exit status

    Multiple libraries were found for "MySensors.h"
    Used: D:\Data\Documents\Arduino\libraries\MySensors
    Not used: C:\Program Files (x86)\Arduino\libraries\MySensors-master
    exit status 1
    Error compiling for board Arduino Nano.


  • Hero Member

    @Lanman said:

    Multiple libraries were found for "MySensors.h"
    Used: D:\Data\Documents\Arduino\libraries\MySensors
    Not used: C:\Program Files (x86)\Arduino\libraries\MySensors-master

    Looks like you just have some issues with your libraries.

    Seems like you have 2 instances of the MySensors library installed in 2 different locations. Maybe you should delete or move the one you are not using to another location.

    Also the Bounce2 library is not included in the MySensors 2.0 library so you need to install it separately if it is missing.
    You can collect the Bounce2 library from this collection -> https://github.com/mysensors/MySensorsArduinoExamples



  • Just as I suspected, it was me doing something retarded, thanks for your help.


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts