Skip to content

Motor right&left backward wrong code #215

@enkith

Description

@enkith

I used the blocks for 'motor DC'. When I put the 'spin motor DC' on 'right&left' 'backward' it generates C-code that doesn't work.
Instead of

digitalWrite(l298n_in3,HIGH);
digitalWrite(l298n_in4,HIGH);
analogWrite(l298n_enb,(255));

it should be

digitalWrite(l298n_in3,HIGH);
digitalWrite(l298n_in4,LOW);
analogWrite(l298n_enb,(255));

This doesn't create an error message. But the motor won't spin, because the state 'HIGH, HIGH' is the same as 'LOW, LOW' - stop.
I'm attaching a screenshot.

grafik

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