Skip to content

ActiveMotor doesn't work on BuildHat #2390

@usausa

Description

@usausa

Describe the bug

ActiveMotor doesn't work on BuildHat.
ActiveMortor works in Python.
It does not work with Iot.Device.Bindings.

Steps to reproduce

I am running BuildHat on a Raspberry Pi 4.
I can use BuildHat to move a motor with the following Python program.

from buildhat import Motor

motor = Motor('A')
motor.run_for_seconds(5)

To do the same thing in .NET, I ran the following code:

using Iot.Device.BuildHat;
using Iot.Device.BuildHat.Models;
using Iot.Device.BuildHat.Motors;

using var brick = new Brick("/dev/serial0");

brick.WaitForSensorToConnect(SensorPort.PortA);
var motor = (ActiveMotor)brick.GetMotor(SensorPort.PortA);

motor.SetPowerLimit(0.7);
motor.SetBias(0.3);
motor.TargetSpeed = 50;

motor.MoveForSeconds(5);

No exceptions are thrown, but the motor doesn't move.

Set the debug LoggerFactory in LogDispatcher.LoggerFactory and attach the file with the log output.

buildhat.log

Do you know the cause?

Versions used

Item Verison
Build Environment dotnet 9.0.3
Execution Environment linux-arm64 self-containedSystem.Device.Gpio

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2Work that is important, but not critical for the releasebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions