multiple condition "if" commands

So... I am very new to the Arduino and I am trying to make a lift that will stop on two conditions. Does anyone know how to set up a function like this????

Yes, but it depends on the rest of your code, and your wiring.

Ok. I have 5 buttons; TOP (up) BOTTOM (down), STOP, and limit switches at the 2 ends of the lift. There are 2 relays: 1 turns the lift motor on/off and one reverses it. My goal is so when TOP is pushed in the bottom position, the lift goes up and vice versa for BOTTOM. when STOP is pushed it stops the lift in place while moving. BOTTOM does nothing while the lift is at the bottom and vice versa for TOP. Thanks!

Please see reply #1

No way to know what the sense of the switches and relays are without seeing a wiring diagram.

Have you written any code yet? If so post it so we have something to help with.



Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components. Posting images:

Use CTRL T to format your code.
Attach your ‘complete’ sketch (as you have it now) between code tags
[code]Paste your sketch here[/code]

if (stopButton() || upperLimit() || lowerLimit()) stopLift();

[u]Logical AND[/u]

[u]Logical OR[/u]

These can be combined in many different ways!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.