I need an intersection program for my robot;if there is an intersection of roads,the robot should not stop or take a turn,it should follow the straight path rather than turning left or right or just stop.
Please help me,its very urgent............
1.Power supply : 12volts
2.7805 is used for power supply.
3.atmega8L microcontoller is used.
4.two gear motors
5.L298 motor drives
The bot has to do the following job (programming work):
1.It has to follow white line track on the black background.
2.It should has high speed.
3. The path has intersection, curve turns, sharp turns (60 degree turn), discontinuities.
This is the prog i m using
Sensors input port - P1
P1_0 --------> Left sensor
P1_4 --------> Right sensor
Motors output port - P0
P0_0 --------> Enable pin of the left half of the H-bridge
P0_1 --------> will drive the left motor in forward direction
P0_2 --------> will drive the left motor in reverse direction
P0_3 --------> will drive the right motor in forward direction
P0_4 --------> Enable pin of the right half of the H-bridge
P0_5 --------> will drive the right motor in reverse direction
/*Delay function runs an idle loop to create a time delay. If the crystal used is of 11.0592 MHz then the argument passed in delay is in 'milliseconds'.*/
void Delay(unsigned int itime)
unsigned int i,j;
for(j=0;j<1275;j++); //Idle loop
/*Generally for turning we use a pulsated wave so the bOt doesn’t get out of control i.e. we run the motor for sometime then again stop it and this is done very quickly to create an effective pulse. See the function below.*/
P0_1=0; /*Left motor is not running in any direction.*/
P0_3=1; /*Right motor is running in forward direction. bOt will eventually turn left*/
Delay(50); /* Wait for 50 ms*/
P0_1=0; /*Motors are not running*/
Delay(50); /*Delay of another 50 ms*/
/*So in the above program we have effectively created a pulse of 100ms which is on for 50ms and off for another 50ms. You can change this value to suit your needs*/
/*Similarly we can write a function to turn right*/
P0_1=1; /*Left motor running in forward direction.*/
P0_3=0; /*Right motor is not running.*/
Delay(50); /*50ms time delay*/
P0_1=0; /*Motors not running in any direction*/
Delay(50); /*50ms time delay*/
/* The pins which are receiving inputs from the sensors should be initially set to logic 1.*/
P1_0=1; /*Left sensor input*/
P1_4=1; /*Right sensor input*/
//main loop of the program
by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
I have already given the whole information,i have given my whole program,and have explained what is the problem and what do i actually require,i can't give any more information than i already have............
Actually no you haven't "its not working" is not a proper description of its actual behaviour. All that tells me is that it doesn't do what you want it to do. That doesn't tell me what it actually does.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...