Line following robot coding

Wrong. It has to move forward if it's on the line. I think you need to forget about the hardware and consider the basic line following logic.

There are people on this forum that will post complete answers. I don't do that because if I see that someone can learn to do it themselves, it wouldn't be doing them any favour, really.

Assignment #2
2. In plain, non engineering language, explain how a line following robot could operate. There are two sensors, so four possible states. Explain what each state should do, and why. Assume that the robot begins on the line.

Hi. After some quick studies on details of line following robot and skimming through some of the syntaxes from the website. I'm starting to get a better idea but still stuck on writing a proper code. To answer your questions, there are 4 states in my sketech, 1. Forward 2. Turn right 3. Turn left 4. After some readings, it said the delay function blocks all of the remaining tasks. Therefore, if I were to add delay of 1 second on the last task Where both IR sensors==HIGH, and LM==HIGH, RM==HIGH, the robot would start moving forward again. However, how would the robot pause for 10 seconds then continuing the loop..

Pseudocode:

if RS
  {
  if LS
    { go forward }
  else
    { turn left }
  }
else
  {
  if LS
    { turn right }
  else
    {
    stop
    wait 10 seconds
    go forward
    wait 1 second
    stop
    }
  }

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.