Microcontroller › PIC › Intelligent ambulance with automatic traffic control › Hello sirThank you for the
Hello sir
Thank you for the reply.
Well I was asking about how is the remote conneceted to pic microcontroller in the ambulance unit?
We also have a code regardinmg this in which three colours for the traffic are mentioned.
#include “reg51.h”
#include “define.h”
main()
{
Initialise();
while(1)
Traffic_Light();
}
Traffic_AC()
{
here:
YA=0;YC=0;YB=0;YD=0;
GA=1;GC=1;GB=0;GD=0; //A and C side Green; B and D side Red
RA=0;RC=0;RB=1;rD=1;
if(count<50)
{
if(Input==0)
{
while(Input==0);
if(A==1 || C==1) //Ambulance from A or C side
{
Traffic_Light();
}
if(b==1 || =1) //Ambulance from B or D side
{
Traffic_Light1();
}
}
goto here;
}
count=0;
}
Yellow_BD()
{
here1:
YA=0;YC=0;YB=1;YD=1;
if(count<20)
{
if(Input==0)
{
while(Input==0);
if(A==1 || C==1) //Ambulance from A or C side
{
Traffic_Light();
}
if(b==1 || =1) //Ambulance from B or D side
{
Traffic_Light1();
}
}
goto here1;
}
count=0;
}
Traffic_BD()
{
here2:
YA=0;YC=0;YB=0;YD=0;
GA=0;GC=0;GB=1;GD=1; //A and C side Green; B and D side Red
RA=1;RC=1;RB=0;rD=0;
if(count<50)
{
if(Input==0)
{
while(Input==0);
if(A==1 || C==1) //Ambulance from A or C side
{
Traffic_Light();
}
if(b==1 || =1) //Ambulance from B or D side
{
Traffic_Light1();
}
}
goto here2;
}
count=0;
}
Yellow_AC()
{
here3:
YA=1;YC=1;YB=0;YD=0;
if(count<20)
{
if(Input==0)
{
while(Input==0);
if(A==1 || C==1) //Ambulance from A or C side
{
Traffic_Light();
}
if(b==1 || =1) //Ambulance from B or D side
{
Traffic_Light1();
}
}
goto here3;
}
}
Traffic_Light()
{
Traffic_AC();
Yellow_BD();
Traffic_BD();
Yellow_AC();
}
Traffic_Light1()
{
Traffic_BD();
Yellow_AC();
Traffic_AC();
Yellow_BD();
}
Thats why we are confused with coulour and number of LEDs.
I request you to please look into it.
Thank you.