Code:
void main(){
char output[7];
int i,rot;
trisb=0x00;
portb=0x00;
UART1_Init(9600);
while(1){
// Initialize string with all '\0'
for(i=0; i<7; i++){
output[i] = '\0';
}
if ((!UART1_Data_Ready()); // if there is UART character in buffer
UART1_Read_Text(output, "m", 255); // read input from uart
for(rot=0; rot<=atoi(output)-1; ++rot)
{
PORTB=0b00010000; delay_ms(200);
PORTB=0b00001000; delay_ms(200);
}
}
}
change to an if statement