wheelchair lift

hi all!!

im in the process of trying to automate a wheelchair lift for my mother. im approaching it it with the “Onebutton” library. it will do what I want it to do in that I can assign multiple functions to one button depending on the number/length of the press(s). the lift has a horizontal movement and a vertical movement. what I need it to do is with a single press, the lift will deploy to the horizontal limit. then with a 2nd single press, deploy to the vertical movement. my thought process has been to track the number of presses but I cant seen to get it to work. I really need some help! any help would be greatly appreciated!!

I have the example code that im baseing it on as well as the sketch ive created…its not complete so please be gentle!!

Lift_2.0_-_final.ino (6.91 KB)

TwoButtons.ino (3.61 KB)

I have the example code that im baseing it on as well as the sketch ive created

Which is which?

What does your code actually do? How does that differ from what you want?

lift 2.0 is mine
Onebutton is the example code

right now im using leds in place of the motors.....I cant seem to get the Arduino to track the button presses/combinations ie. single, double, long, etc. also, to "know" where the lift is by reading the location sensors and act according to the previous press and the current press. from the retracted "home" position, when it receives a single press, it reads the location sensors, and energizes the horizontal motor to deploy to the horizontal limit. on a 2nd press, read the location, and energize the vertical motor to the vertical deploy limit. I put a link to the demo video of the lift we have. Ive highly modified it from what is shown (upgraded motors and eliminate the hand controls) I want to break up the deploy/retract into stages for the horizontal and vertical positions. I want to assign the stages to a single press and use the double press for a "full deploy" function. I have separate switches for deploy and retract. thanks for the reply!! let me know if you need anything else or have more questions!!

Door_Open = (Door_Closed == false && Door_Open == true);
Door_Closed = (Door_Closed == true && Door_Open == false);

This is bound to bite you in the ass, sooner or later. The door is either open, closed, or somewhere in between. You don't seem to care about the somewhere in between, so the door is open or it isn't. You don't need to booleans to know that.

  digitalRead (Door_Open);
  digitalRead (Door_Closed);

You are reading the true and false pins, without caring about what you read. Doesn't make sense.

  if (Door_Open == false && Door_Closed == true);{

If statements that end in semicolons are as common as unicorns.

}}

NEVER put two or more } on one line.

digitalRead (Deploy_Button_Counter);
digitalRead (Deploy_Button_Last_Counter);

More useless reads.

Deploy_Button_Counter++;

You are counting the number of times that this function is called. The name should reflect that.

That was as far as I could manage. Your code layout is abominable.

Put EVERY { on a line BY ITSELF.
Put EVERY } on a line BY ITSELF.
Use Tools + Auto Format to properly indent your code.

PaulS:
Use Tools + Auto Format to properly indent your code.

...and if the auto-format appears to scramble your code then the code was wrong.