Simple line finder


#1

I give you three small pictures, some source code and three short youtube video’s of the line finder I made with makeblock today.

the front:

the back:

the bottom:

video of slow moving line finder (35 seconds):

video of fast moving line finder (24 seconds):

#include <Me_BaseShield.h>
#include <Me_BaseShieldMotorDriver.h>
#include <Me_LineFinder.h>

Me_BaseShieldMotorDriver baseShieldMotorDriver;
Me_LineFinder lineFinder(PORT_5); 

void setup()
{         
    baseShieldMotorDriver.begin();
}

void loop()
{
    int sensorState = lineFinder.readSensors();
    if(sensorState == S1_OUT_S2_IN)
    {
        baseShieldMotorDriver.runMotors(150,140);
    }
    if(sensorState == S1_OUT_S2_OUT)
    {
        baseShieldMotorDriver.runMotors(0,150);
    }
}

#2

Thank you for your sharing Paul.

We also make a staff contest about the Line Finder robot last Saturday in our company and made a lot of fun by buiding, coding, testing and running it.


#3

Hi! I noticed there and the line diameter(side to side) is real small. My mbot when goes in that line, it shakes alot.
Do you know how to fix it?