Example programs

The same examples the VS Code extension lists under Examples: for every part of the robot a minimal and a complete program, in Python and, where there are blocks for it, in blocks. Download one and open it in the extension (a .evnblocks file opens in the blocks editor). Needs says what to plug in, and how to set the robot up, before you run it.

Board, button, LED and timing battery, button, LED, wait, StopWatch

Motor EV3 / NXT motors on ports 1-4

Robot (DriveBase) two wheel motors driven together

Pose (where the robot is) position and heading from the wheels, an IMU and a compass

Colour sensor TCS34725 on an I2C port

Distance sensor VL53L0X time of flight on an I2C port

Gesture sensor APDS-9960 on an I2C port

Environment sensor BME280: temperature, humidity, pressure

Compass magnetometer on an I2C port, with its calibration

Touch pads MPR121, 12 pads

IMU gyro and accelerometer, with its calibration

ADC ADS1115: four analogue inputs

Display 128x64 OLED

LED matrix 8x8 matrix (HT16K33)

7-segment display four digits (HT16K33)

RGB LEDs WS2812B strip on a servo port

Servo hobby servos on ports 1-4

Bluetooth HC-05 module on a serial port

UART (serial ports) Serial 1 and 2 as plain UARTs (MicroPython's machine.UART)

I2C (any device) raw I2C on ports 1-16, for devices without a class

Files on the board open(), os and the flash file system

Data log (recorded on the board) motors, sensors, the battery and your own rows, saved to a CSV file

Controllers (PID and ADRC) your own control loops: a line follower, a heading hold

Extended Peripherals HiTechnic NXT colour sensor and compass, HuskyLens, VL53L1X, TCS3430

HiTechnic colour sensor HiTechnic NXT Color Sensor V1 / V2 (NXT cable adapter, 100 kHz)

HiTechnic compass HiTechnic NXT Compass Sensor (NXT cable adapter, 100 kHz)

HuskyLens DFRobot HuskyLens AI camera (I2C mode)

VL53L1X distance sensor ST VL53L1X time-of-flight distance sensor, up to 4 m

TCS3430 colour sensor ams-OSRAM TCS3430 XYZ colour and light sensor