Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code for wall following robot using atmega16
#1

PROGRAM FOR WALL FOLLOWER.
#include<avr/io.h> // For ATMega8
int main(void)
{

DDRC=0x00; // set PORTC as input port
DDRB=0x0F; // PB0, PB1, PB2, PB3 as output port for motor
int Right_sensor=0;

while(1) // infinite loop
{
Right_sensor=(PINC&0x01); //sensor status connected at PC0
if(Right_sensor==0x00) //right sensor OFF

{
PORTB=0x08; //right turn
}

else
PORTB=0x01; //left turn
}

}
Reply

#2

please send me the code for wall following robotic car which can avoid obstacles too which come on its way(obstacles which come on the way while following wall )
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.