Download Print this page

NEX ROBOTICS Fire Bird V ATMEGA2560 Software Manual page 71

Robotic research platform
Hide thumbs Also See for Fire Bird V ATMEGA2560:

Advertisement

NEX Robotics
4.2.3.2 Function for moving robot forward and back by specific distance
//Function used for moving robot forward by specified distance
void linear_distance_mm(unsigned int
{
float
ReqdShaftCount = 0;
unsigned long int
ReqdShaftCountInt = 0;
ReqdShaftCount = DistanceInMM / 5.338;
ReqdShaftCountInt =
ShaftCountRight = 0;
while(1)
{
if(ShaftCountRight > ReqdShaftCountInt)
{
break;
}
}
stop();
//Stop robot
}
4.2.3.3 Forward in mm
void forward_mm(unsigned int
{
forward();
linear_distance_mm(DistanceInMM);
}
4.2.3.4 Backward in mm
void back_mm(unsigned int
{
back();
linear_distance_mm(DistanceInMM);
}
4.2.3.5 left in degrees
void left_degrees(unsigned int
{
// 88 pulses for 360 degrees rotation 4.090 degrees per count
left();
//Turn left
angle_rotate(Degrees);
}
4.2.3.6 right in degrees
void right_degrees(unsigned int
{
// 88 pulses for 360 degrees rotation 4.090 degrees per count
right();
//Turn right
angle_rotate(Degrees);
}
www.nex-robotics.com
DistanceInMM)
// division by resolution to get shaft count
(unsigned long
int) ReqdShaftCount;
DistanceInMM)
DistanceInMM)
Degrees)
Degrees)
Fire Bird V Software Manual
71

Advertisement

loading
Need help?

Need help?

Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?