E2 not working

Hi, I’m new at E2, so I’m not very good. I’ve been trying to get a Spacebuild door to open when you push one of three buttons and close if one isn’t being pressed.

Here is the code I’ve been trying to use:



@name Multi-Button Door
@inputs Button1 Button2 Button3
@outputs Door

if(Button1|Button2|Button3==1){Door==1}
else{Door==0}


Can anyone give me a piece of code to do what I’m trying to do?

It looks fine to me

The problem is here.
When you check if something is equal (when you compare), you use “==”.
When you set a variable to something, you use “=”.

So your


Door==1
#and
Door==0

must be


Door=1
#and
Door=0

Oh, thanks. I’ll go test it right now.

I hate to say it, but couldn’t you just use an Or gate under Logic?

Well, it’s too late. The E2 worked. Oh, and I chose E2 because
A.) I’m trying to learn it
and
B.) It requires less Wire.

A) Ok good :slight_smile:
B) Not in this example :confused: