mBot turns 180 degrees instead of 90


#1

Here is my code:




I’m not sure what is wrong with it. The turn right function works properly, but turning left makes the robot turn 180 degrees instead of 90.
I’m using a mBot and the makeblock Me 3-Axis Accelerometer and Gyro Sensor V1.2
Variables gyro_z_offset is defined to be the current angle of the robot at the start of the program and ideal angle is set to 0 (also at the start)


#2

@Best_codes? Do you have anything? I can’t see anything wrong.


#3

@holothere
Something you need to check:
When spinning to the right and left, does the z axis value always increase in both directions from the center, or does it decrease in one direction and increase in the other?


#4

I m new to mbot and to programming I bought it for mi son and we are experimenting with blockly app we understand the very basics but we are having a lot of trouble with more complex coding. Do you have any suggestions on where get help, most are focused now on mbot neo


#5

@mbotmom
Asking here on the forum is a great resource. :smile:
You can create posts with any questions you have and get support from the community.


#6

Did you get my file?


#7

@mbotmom Or you could send us a DM by clicking on one of our profile pictures.