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);
}
}