[Solved] connecting a 3-button window blind wall controller

[Solved] Finally I decided to re-wiring all the project and now it's working !! Thanks for your help...

Hi. I'm trying to control a motorized window blind, with his own wall controller, with arduino in order to allow both control modes: with the ancient wall controller and with arduino's code.
But I'd like to re-use my controller, that has 3 buttons: Up, Down and Stop.
I've connected it with 5v to the 'L' terminal, and from both Up and Down terminals, one connection to a DO of the arduino and one to the GND, with a 10-resistence between.
This way, I'm able to detect 'UP' pulse, and stops when any other button is pulsed, but anything else.
I've tried my code with 2 single buttons (up & down) and works correctly, but I'd need to use the ancient wall controller.
Any help would be appreciated!!

Pictures, pictures, pictures.

Perfectly focused.

And code.

Using "code" tags.

If you do not know what they are, read the instructions first.

Ok. I will enclosure some pictures and the code, it they can help

Bounce DEB_BUTTON_UP = Bounce(); // Debouncer button up
Bounce DEB_BUTTON_DO = Bounce(); // Debouncer button down
int oldValue_UP=0;
bool state_UP;
int oldValue_DO=0;
bool state_DO;

void setup(void)
{
   
  pinMode(BUTTON_UP_PIN, INPUT);
  pinMode(BUTTON_DOWN_PIN, INPUT);
  digitalWrite(RELAY_ON_PIN, RELAY_OFF);
  digitalWrite(RELAY_UP_PIN, RELAY_OFF);  
  pinMode(RELAY_ON_PIN, OUTPUT);
  pinMode(RELAY_UP_PIN, OUTPUT);
  
  // Activate internal pull-up
  digitalWrite(BUTTON_UP_PIN,HIGH);
  digitalWrite(BUTTON_DOWN_PIN,HIGH);
  
  // After setting up the button, setup debouncer
  DEB_BUTTON_UP.attach(BUTTON_UP_PIN);
  DEB_BUTTON_DO.attach(BUTTON_DOWN_PIN);
  DEB_BUTTON_UP.interval(5);
  DEB_BUTTON_DO.interval(5);
}

void loop(void)
{
      DEB_BUTTON_UP.update(); 
      // Get the update value
      int deb_up_value = DEB_BUTTON_UP.read();
      
      if (deb_up_value == HIGH) {     
          Serial.println("UP !!!");        
          //digitalWrite(13, HIGH );
      }
//      else  digitalWrite(13, LOW);

      DEB_BUTTON_DO.update();
      int deb_down_value = DEB_BUTTON_DO.read();
      
      if (deb_down_value == HIGH) {      
          Serial.println("!!!down");                        
          digitalWrite(13, HIGH );
      }
      else  digitalWrite(13, LOW);

}

  // Activate internal pull-up
  digitalWrite(BUTTON_UP_PIN,HIGH);
  digitalWrite(BUTTON_DOWN_PIN,HIGH);

No, it doesn't. At least, not to my knowledge. I think a write to a pin configured for input does nothing. At least, in my world it should. If it does, it should be changed to avoid confusion.

  pinMode(BUTTON_UP_PIN, INPUT_PULLUP);
  pinMode(BUTTON_DOWN_PIN, INPUT_PULLUP);

Would.

aarg:

  // Activate internal pull-up

digitalWrite(BUTTON_UP_PIN,HIGH);
  digitalWrite(BUTTON_DOWN_PIN,HIGH);



No, it doesn't. At least, not to my knowledge. I think a write to a pin configured for input does nothing. At least, in my world it should. If it does, it should be changed to avoid confusion.

Oh dear! A bad case of foot in mouth disease on your part!

That is precisely how the INPUT_PULLUP is enabled, and in fact, that is the more reliable way of writing it as while the function has always been essential to the AVRs, earlier version of the IDE (such as the one I am using FBOW) do not have INPUT_PULLUP, so that is how you code it.

And incidentally, the output of the optimising compiler should be identical either way.

Paul__B:
Oh dear! A bad case of foot in mouth disease on your part!

That is precisely how the INPUT_PULLUP is enabled, and in fact, that is the more reliable way of writing it as while the function has always been essential to the AVRs, earlier version of the IDE (such as the one I am using FBOW) do not have INPUT_PULLUP, so that is how you code it.

And incidentally, the output of the optimising compiler should be identical either way.

Well, I had a feeling... or I wouldn't have expressed doubt! But I don't think it is a very good method, as it is very non-descriptive of the actual outcome (and I'm being generous here... I really want to say misleading), hence non-intuitive at best. So I'm sticking to my story.

It could - and should - be looked at the other way around.

If one is going to be using INPUT_PULLUP, it is a very good idea to know what you are doing, which is enabling a pull-up by writing a HIGH to the output register (bit) and setting the DDR (bit) to input. If for some reason (I2C is such a reason) you now want to use the port as an output, it is as well to know that the output will be HIGH unless or until you first set the output register to LOW, because if you do not realise that INPUT_PULLUP sets it HIGH, you might think that it had defaulted to LOW (as it does on reset) or that you had previously set it LOW.