Import the modules
On the EV3 the gyro acts as a stock gyro, so no library is needed: Pybricks' built-in LUMPDevice reads its "modes" directly (each mode sends back a few numbers).EV3 MicroPython v2 reads the gyro's "modes" directly with the built-in Ev3devSensor; nothing to download.
- Open code.pybricks.com in Chrome and put the Pybricks firmware on the EV3 as the site explains (the EV3 version is in beta).
- Turn on the EV3 first, then plug the gyro into a sensor port (keep the robot still at that moment).
- Create a new program and write these lines at the top (marked ① on the right).
- Boot the EV3 from the official LEGO EV3 MicroPython microSD card.
- Install the "LEGO MINDSTORMS EV3 MicroPython" extension in VS Code and create a project.
- Open
main.pyand write these lines at the top (keep the#!line 1). Press F5 to download and run.