Society of Robots
Search and Index
MISC
 Parts List
 Robot Forum
 Chat
 Member Pages
 Axon MCU
 Robot Books
 Shop
 Contact

SKILLS
 How To Build
  A Robot
  Tutorial

 Calculators
 Mechanics
 Programming
 Miscellaneous

 Robots
 Space

HARDWARE
 Actuators
 Batteries
 Electronics
 Materials
 Microcontrollers
 Sensors

SCIENCE
 Robot Journals
 Robot Theory
 Conferences


    PROGRAMMING - LINE FOLLOWING

    code

    This page goes with tips to win MOBOT.

    note: this page is a place holder until a better tutorial is written

    Autoconfig
    This algorithm allows your robot to determine its own binary threshold for detecting the line.

      How to Use This Algorithm
      Set up your IR emitter/detector sensors and place all of them facing the concrete. Get a reading, then place all of them on the white line and get another reading. Now you have two readings for each IR. Find the average of each, and set them as the threshold for each.

      Pseudocode:

        read IR1c //read on concrete
        read IR2c
        read IR1w //read on white line
        read IR2w

        (IR1c + IR1w)/2 = IR1thresh
        (IR2c + IR2w)/2 = IR2thresh

    Infrared line detection with 2 IR
    This algorithm allows your robot to follow a white line.

    2 IR on MOBOT course

      How to Use This Algorithm
      Set up your two IR emitter/detector sensors so that one is on the left of the line and the other on the right. As long as neither detects the white line it means your robot is following the line. If either detects the line, the robot must make course corrections.

      Pseudocode:

        read leftIR
        read rightIR

        if leftIR detects line
        then turn robot left until not true

        if rightIR detects line
        then turn robot right until not true

        if neither IR detects line
        then robot goes straight

        loop



Get Your Ad Here

Has this site helped you with your robot? Give us credit - link back, and help others in the forums!
Society of Robots copyright 2005-2014
forum SMF post simple machines