Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. rayan
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    rayan

    @rayan

    0
    Reputation
    25
    Posts
    416
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    rayan Follow

    Best posts made by rayan

    This user hasn't posted anything yet.

    Latest posts made by rayan

    • RE: Multi Button Relay Sketch

      @Boots33
      hi my friend.
      i use your sketch and thank you.but there is a problem.
      sketchs in site , when relay is fail , when i send command , so show to me "Error sending switch command, check device/hardware !" but your sketch dont show this error. so i dont understand relay is fail or no , when we are out home. can you fix this ?

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @pepson
      i dont have a ready sketch! wait to boots answer

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @pepson

      @Boots33 can solve this maybe because i dont work with Bounce2 lib.

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @Boots33
      ack is a feedback . is this true ? so when i am out of home and i want turn on light , so ack show me that light is on or no ! also when there is a problem in connection and ack dont receive, so node search and found a new way for connection.
      now i dont have a arduino and radio for test 🙂 but do you think this code will be ok ?without else.

      void loop()
      {
       if (!isTransportOK())
      {
      if (...)            //if change switch to up or down
      ...                 //change state of relay
      if(isTransportOK())
      send(msg.set(state ? true : false), true);  // (last state)
      }
        
        debouncer.update();
        // Get the update value
        int value = debouncer.read();
        if (value != oldValue && value == 0) {
          send(msg.set(state ? false : true), true); // Send new state and request ack back
        }
        oldValue = value;
      }
      

      (i can not work with Bounce2 library 🙂 ) please help to fill lines
      in loop we add a "if (!isTransportOK())" and write when change switch (on/off) state of relay change and this is repeat until connection will be ok ! so send a ack and for continue follow your code...
      is this right ? can you do this change ?

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @Boots33
      ack is important , so we can not found any solution for this ? for exapmle add a code to this sketch , that when radio is disconnect so without ack work and when radio is ok this way stop and with ack work again.
      this idea is for when a radio have problem or fail or other reason... so this light or other divece dont stop working and work handy when radio go to correct or change radio....

      if you can change your code and add this option , so your sketch is best code for light control

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @pepson
      i am beginner and i hope some one help to you

      posted in Development
      rayan
      rayan
    • RE: Multi Button Relay Sketch

      @Boots33 this your code is good, but there is a small issue .button work just when the connection is ok (radio with gateway) ! and when radio is disconnect or controller is off, so button dont work handy . do you have any idea for this ? that when controller is off the button work handy

      posted in Development
      rayan
      rayan