Projects with Python·Tutorial 1 of 5

Distance Display

Intermediate

Build a polished live distance display using the HC-SR04 sensor and the OLED screen. Add a visual bar that grows and shrinks with distance, and colour-code the LED to give an at-a-glance range indicator.

25 min5 steps
DistanceHC-SR04OLEDDisplayProjectIntermediate
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.

The HC-SR04 is wired to GP16 (TRIG) and GP17 (ECHO) — no extra connections needed.