Skip to content

Bug in stepperDegreeDual_42 function in main.ts #10

Description

@lbernard9

Hello,

I found a missing condition in the stepperDegreeDual_42 function in the main.ts file.

When Degree1 == Degree2, there is no specific handling, which can lead to incorrect behavior. I think an additional else condition should be added at the end of the function to handle this case.

Suggested fix:

else { // Degree1 == Degree2
timeout1 = (50000 * Degree1) / (360 * 100)

setStepper_42(0x01, direction1 > 0);
setStepper_42(0x02, direction2 > 0);

basic.pause(timeout1);

motorStop(1);
motorStop(2);
motorStop(3);
motorStop(4);

}

This should correctly handle the case where both motors need to rotate the same number of degrees.

Thank you for your work on this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions