code question

<= 0 || brightness >= 255)

Just getting started. In the examples I have the above in the fade code. The two vertical lines between the 0 and brightness are not on my keyboard. Can they be replaced with something else?

You can use two of these |

Copy and paste from this thread. 8^)

My | key is above the \ and looks more like a colon, not a solid bar.

You can just use the word "or". Not being sarcastic, either... :slight_smile:

(brightness <= 0 or brightness >= 255)

RogerBeck:
Just getting started. In the examples I have the above in the fade code. The two vertical lines between the 0 and brightness are not on my keyboard. Can they be replaced with something else?

Are you sure they are not above the backslash (shift-backslash)?

PaulMurrayCbr:
Are you sure they are not above the backslash (shift-backslash)?

"They" would not be above the backslash, since it takes two keystrokes to get ||.

(Is yours a solid bar? Mine is actually two bars with a gap like a long colon. I would think that would be confusing for a newbie.)

Picture of what it looks like on a US keyboard.

Thanks guys I'm fixed.

RogerBeck:
<= 0 || brightness >= 255)

Just getting started. In the examples I have the above in the fade code. The two vertical lines between the 0 and brightness are not on my keyboard. Can they be replaced with something else?

You can use a conditional expression to replace the || and && operators as that is what they are equivalent to,
here

(brightness <= 0 ? true : brightness >= 255)