Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

why degree is raise all the time? #2

Open
judemoses opened this issue Jan 14, 2021 · 1 comment
Open

why degree is raise all the time? #2

judemoses opened this issue Jan 14, 2021 · 1 comment

Comments

@judemoses
Copy link

hi !my english is limited 我猜你是中国人!我也是!如果可以的话请求你的帮助![email protected]
i want to turn by gyro,but i fail,the degrees of gyro is raising ,is a bug?how can i fix it?

void GyroLeftTurn(int nLTargetDegree, int nTurnLPower) {
//ev3_gyro_sensor_reset (SENSOR_G);
while (-1 * (ev3_gyro_sensor_get_angle(SENSOR_G)) <= nLTargetDegree) {
ev3_motor_set_power(R_MOTOR, nTurnLPower);
ev3_motor_set_power(L_MOTOR, 0);
}

ev3_motor_stop(L_MOTOR, true);
ev3_motor_stop(R_MOTOR, true);

}

@qiux7hyun
Copy link

reset the gyro:
get out the gyro line,
put it in again and don't move gyro before it up(until u can read angle)

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

No branches or pull requests

2 participants