void main(){
unsigned char txt[2];
unsigned char output[7];
int y,rot;
char on[28]; // char table to store received string
int intme;
trisb=0x00;
portb=0x00;
UART1_Init(9600);
while(1){
while (!UART1_Data_Ready()); // wait for UART character in buffer
UART1_Read_Text(output, "m", 255); // read one character from uart
y=strlen(output);
on[y]=output;
on[y+1]='\0'; // insert terminating zero
for(rot=0; rot<=atoi(on)-1; ++rot)
{
PORTB=0b00010000; delay_ms(200);
PORTB=0b00001000; delay_ms(200);
}
}
}