OttoDIY / blockly

Otto Blockly; a fully integrated graphical programming for any type of Arduino projects, including robots, ready to install in your computer, it works offline and also online
https://www.ottodiy.com/software
GNU General Public License v2.0
118 stars 81 forks source link

Motor right&left backward wrong code #215

Open enkith opened 3 weeks ago

enkith commented 3 weeks ago

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