char UART_temp;
unsigned char data_send [50];
int num = 0;
int count=0;
void ledblink()
{
PORTD=0x00;
Delay_ms(100);
PORTD=0xFF;
Delay_ms(100);
PORTD=0x00;
Delay_ms(100);
PORTD=0xFF;
}
void main() {
ADCON1=0x0F;
TRISD=0x00;
PORTD=0xFF; //LED INDICATOR ON portD
UART1_Init(2400); // Initialize UART module
Delay_ms(1000); // Wait for UART module to stabilize
data_send[0] = 0x0D;
data_send[1] = 0x01;
data_send[2] = 0x53;
data_send[3] = 0x31;
data_send[4] = 0x6E;
ledblink();
while (1) {
if((UART1_Tx_Idle() == 1) && (num<5))
{
UART1_Write(data_send[num]);
num=num+1;
}
}
}