Recommended Posts

Posted

I have an led that I want to be green if either of two values are 12 or above . The channel is a1,  a1>=12 works fine. Toggles properly. I also have a variable a1d. I have tried a bunch of permutations of brackets and such to get this to work. a1 || a1d >=12. So if either a1 or a1d is 12 or more, the LED component will be green, else red.

Never mind. I had declared the variable, but not assigned it a value. Now it seems happy.

Moderator can delete this post if you like.

Posted

A1 || A1D >=12 does not do what you think.  It means "if A1 is non-zero, or A1D is greater than or equal to 12".  What you want is:

(a1 >= 12) || (a1D >= 12)

You have to compare them separately.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.