Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
1. Is this just a two-floor elevator? I would assume so, since you are only using one push button.
2. Is this an accurate description of how you want the elevator to work (assuming only two floors)?:
Elevator starts on floor 1, both indicators off.
Push the button; elevator starts moving up to floor 2, up indicator on.
Elevator arrives at floor 2; elevator stops moving, both indicators off.
Push the button; elevator starts moving down to floor 1, down indicator on.
Elevator arrives at floor 1; elevator stops moving, both indicators off.
3. How are you moving the elevator? Pistons, a winch, etc.?
I am going to work on this myself and see what I can come up with.
https://imgur.com/3Im1Tu3
Microcontroller with 2 inputs: Push button in, Piston rod length in; and 3 outputs: Piston length out, Up indicator out, Down indicator out.
Describing the microcontroller:
The constant inputs to the numerical switchbox are the up/down piston lengths. Adjust as needed for your floors. +/- 1 fully extends and retracts the piston.
The multiply (by 0.5) is because the piston outputs a length of 0.5 when you ask it to fully extend (inputting target of 1).
The subtract (current length minus target length), less-than, and greater-than determine which direction the piston will be moving (or not moving at all if target = current). The reason I used +0.02 and -0.02 is to create a 'not moving' tolerance band. The piston never actually outputs exactly +/- 0.5, so this band gives the game some tolerance. If you notice the indicators are flickering when they should not be, try expanding this tolerance band (e.g., try +/- 0.03).
The only things you should need to adjust here are the up/down piston lengths in the switchbox, which I made +/- 1, and the tolerance band to resolve flickering. The rest of the logic will automatically adjust itself to these changes.
I have a distance sensor on the bottom of elevator's floor, that can measure the distance, but i don't know how can I use it right.
https://imgur.com/a/qCjErrj
There's the solution.
https://imgur.com/a/unR2Y9b