Read a Switch with Python

Beginner

Use an if/else statement to light the GRN LED whenever you hold down Switch A. Your first Python program that reacts to the physical world in real time.

12 min5 steps
SwitchLEDIf/ElsePythonBeginner
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.