RaspberryPiFoundation / python-build-hat

Build HAT Python library
MIT License
55 stars 19 forks source link

Is it possible to control a lego power function motor with the build hat? #185

Closed HannahFehringer closed 1 year ago

HannahFehringer commented 1 year ago

Hello,

basically my issue title already sums up my question: Is it possible to control a lego power function motor with the build hat?

There do exist some cable which allow a connection between powered up and power function devices. However, if I connect my lego pf motor with the raspberry pi build hat, I get the following error message: buildhat.exc.DeviceError: There is not a Motor connected to port A (Found PassiveMotor)

This tells me that it found a motor, but not the expected one. Does anybody have experience with this issue?

mutesplash commented 1 year ago

You need to use the PassiveMotor class and not the Motor class.

chrisruk commented 1 year ago

Yes, that's correct, there's an example at the bottom of https://buildhat.readthedocs.io/en/latest/buildhat/passivemotor.html

chrisruk commented 1 year ago

Will close this now, feel free to open another issue if there's anything else