kedi Posted July 29, 2021 Share Posted July 29, 2021 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. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 30, 2021 Share Posted July 30, 2021 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. Quote Link to comment Share on other sites More sharing options...
kedi Posted July 30, 2021 Author Share Posted July 30, 2021 Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.