Making Decisions: If and Else

Beginner

Teach your board to choose between two actions. Use an if/else block to check whether Switch A is pressed and light a different LED for each answer.

10 min5 steps
LogicIf/ElseSwitchesLEDProgrammingBeginner
0 of 5 steps

Step 1 of 5

Connect your board

Power on your Beaver Board — the OLED will show a PIN code. Click Connect in the toolbar, choose Connect via Bluetooth, and select your board. If it's your first time, enter the PIN shown on the screen.