Build HAT
Library
The Build HAT library has been created to support the Raspberry Pi Build HAT, an add-on board for the Raspberry Pi computer, which allows control of up to four LEGO® TECHNIC™ motors and sensors included in the SPIKE™ Portfolio.

Other LEGO® devices may be supported if they use the PoweredUp connector:

In order to drive motors, your Raspberry Pi and Build HAT will need an external 7.5V power supply. For best results, use the official Raspberry Pi Build HAT power supply.
Warning
The API for the Build HAT is undergoing active development and is subject to change.