From 1fcc21169ab15064ca0acbc0688d2f75a835a443 Mon Sep 17 00:00:00 2001 From: prot Date: Fri, 10 Dec 2004 02:01:05 +0000 Subject: Adding pid for linefol mode. (Still under work) --- n/line-follower/src/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'n/line-follower/src/main.c') diff --git a/n/line-follower/src/main.c b/n/line-follower/src/main.c index 72d4b39..f0059f9 100644 --- a/n/line-follower/src/main.c +++ b/n/line-follower/src/main.c @@ -38,7 +38,8 @@ /** Motor mode : * 0 - pwm setup; * 1 - speed control; - * 2 - position control. */ + * 2 - position control; + * 3 - linefol mode. */ int8_t motor_mode; /** Main loop counter. */ @@ -107,7 +108,11 @@ main_loop (void) postrack_update (); motor_timer_2 = timer_read (); /* Speed control. */ - if (motor_mode >= 1) + if (motor_mode = 3) + { + speed_compute_linefol_pwm (); + } + else if (motor_mode >= 1) { speed_update (); speed_compute_left_pwm (); -- cgit v1.2.3