Sie sind auf Seite 1von 5

MODEL-SHUTTLE

CAR BRAKING USING


INFRARED SENSOR
SUBMITTED BY:
SUMIT BASANTRAY
110MN0387

PROGRAM BURNT ON THE DEVELOPMENT BOARD:


#include <avr/io.h>
#include <util/delay.h>
//#include "irc_lcd.h"

int main(void)
{
//InitLCD(1); //initialize the LCD in BLINKING CURSOR mode
//LCDClear(); //clear any previous LCD contentsuint8_t x,y;
int a,b;
DDRA=0b00000000;
DDRB=0b11111111;
PORTA=0b11111111;
PORTB=0b11111111;

while(1)
{

a=PINA & 0b01111111;


if(a==0b0011100 || a==0b0010100 || a==0b0001100 ||
a==0b0011000 || a==0b0010000 || a==0b0000100 || a==0b001000 )
{
b=0b00001010;//fwd
// LCDWriteStringXY(0,0,"fwd");
}
else if(a==0b0011111 || a==0b00000001 || a==0b0000111 ||
a==0001111 || a==000101)
{
b=0b00001000;//lft
//LCDWriteStringXY(0,0,"left");
}
else if(a==0b1111100 || a==0b1010000 || a==0b1000000 ||
a==0b1110000 || a==0b1100000)
{
b=0b00000010;//rt
//LCDWriteStringXY(0,0,"right");
}
else
{

b=0b00000000;
//LCDWriteStringXY(0,0,"fwd");
}

PORTB=b;

FABRICATION COST:
DEVELOPMENT BOARD-Rs 1700
ATMEGA 16-Rs 600
INFRARED SENSORS- Rs 200
MOTOR-Rs 350
PROGRAMMER-Rs 600
WIRE-Rs 50
CHASSIS-Rs 30
Total-Rs 3530

Das könnte Ihnen auch gefallen