Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Motor right&left backward wrong code #215

Open
enkith opened this issue Nov 11, 2024 · 0 comments
Open

Motor right&left backward wrong code #215

enkith opened this issue Nov 11, 2024 · 0 comments

Comments

@enkith
Copy link

enkith commented Nov 11, 2024

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant