This is an old revision of the document!
The switch used has three connection pins:
Your button(s) should produce an input for the RED, GREEN, and BLUE LEDs. All the buttons should be set to input mode since they're input devices. With that information, I would code the button to the corresponding LED. So Red button to the red LED, blue to blue, and green to green. The switch also should be set to input, just like the buttons are.
[ptb2] The multicolor LED should output the colors RED, GREEN, and BLUE. With that information , I would personally color code the buttons associated with the specific color desired when the button is pressed. Meaning have a RED button cap for when you want the multicolor LED to output RED, and so on for each color. This just makes it easier to test your code.
The if else statement essentially means that “ if this condition is true do the following thing, else do this thing instead”. If the condition inside the parentheses evaluates to true , the code inside the if block will execute.