code line following using MBLAB program

Program Code : .
The program was written by using MBLAB program . In this program 2 PWM channels
are used to reduce engine speeds. For details, you can make contact with author
quoc_huy115@yahoo.com
*********************************************
void main(void)
{
unsigned char i;
TmrGen = 0x0;
System_Init(); // user.c
RunFlag = 0;
Sensors._byte = 0x0;
LED5_On();
if(RunFlag)
{
i = Sensors._byte & 0xF;
switch(i)
{
case 0b0000:
Stop();
break;
case 0b0110:
case 0b0010:
case 0b0100:
Run();
break;
case 0b1100:
case 0b1000:
Turn_Right();
break;
case 0b0011:
case 0b0001:
Turn_Left();
break;
}//end switch
}
else
}//end main
*************************************************

No comments:

Post a Comment

its cool