Line follower
Tasks:
- Write the program to control the robot follow the line ( actually above the edge between black and white area ). Some programming hints you can find in [@lst:340_Line_Follower] :
#include <RobotMovingFunctions.h>
const int LIGHT_SENSOR_PIN = A0;
const int SURFACE_BRIGHTNESS_REFERENCE = 400;
void setup()
{
setIOpins();
pinMode(LIGHT_SENSOR_PIN , INPUT);
}
void loop()
{
int light_sensor_value = analogRead(LIGHT_SENSOR_PIN );
if ( light_sensor_value < treshold_value )
{
// do this if robot is over the black line
}
else
{
// do this if robot is over white area
}
}
: Line Follower. {#lst:340_Line_Follower}
Questions:
- What is the program function to get the
light_sensor_value
? - Determine the movements of the robot if the robot is over the black area and if the robot is over the white area.
Summary:
<++>
<++>
Issues:
<++>
<++>