summaryrefslogtreecommitdiff
path: root/n/line-follower/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/line-follower/src/main.c')
-rw-r--r--n/line-follower/src/main.c9
1 files changed, 7 insertions, 2 deletions
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 ();