// Project name : DTMF Controlled Robot
// Designed By  : ROBOMART
//                http://www.robomart.com

/* Program for "Mobile Controlled Robot" 
___________________________________________________

Connection settings of Kit

DTMF---@------------->P0.0, P0.1, P0.2, P0.3

RIGHT MOTOR(+)------->P2.0
RIGHT MOTOR(-)------->P2.1
LEFT MOTOR(-)-------->P2.2
LEFT MOTOR(+)-------->P2.3

RESET-------------------------->PIN9
Crystal Ossilator-------------->PIN18 and PIN19
VCC=Regulated 5V
Gnd=Ground(0V)
*/


#include<reg52.h>
sbit dtmf1 = P0^0;   
sbit dtmf2 = P0^1;
sbit dtmf3 = P0^2;
sbit dtmf4 = P0^3;

void main(void)
{
dtmf1=1;		   //make this pin as input port.
dtmf2=1;		   //make this pin as input port.
dtmf3=1;		   //make this pin as input port.
dtmf4=1;		   //make this pin as input port.
P2=0x00;           // make port2 as output port.
while(1)
{
if((dtmf2==1)&(dtmf1==0)&(dtmf3==0)&(dtmf4==0))	   // if 2 key of your mobile keypad is pressed
P2=0x09;  //forward	movement
if((dtmf4==1)&(dtmf1==0)&(dtmf2==0)&(dtmf3==0))	   // if 8 key of your mobile keypad is pressed
P2=0x06;   //back movement
if((dtmf4==0)&(dtmf1==0)&(dtmf2==0)&(dtmf3==1))	   // if 4 key of your mobile keypad is pressed
P2=0x01;  // left movement
if((dtmf4==0)&(dtmf1==0)&(dtmf2==1)&(dtmf3==1))	   // if 6 key of your mobile keypad is pressed
P2=0x08;  //right movement
if((dtmf4==0)&(dtmf1==1)&(dtmf2==0)&(dtmf3==1))	   // if 5 key of your mobile keypad is pressed
P2=0x00;  //stop movement

 }
}