Code: Select all
void main()
{
uart1_init(9600);
ddra.B0=1;
porta.B0=0;
while(1)
{
if(uart1_data_ready()==1)
{
if(uart1_read()=='a')
{
porta.b0=!porta.b0;
}
}
}
}
#1 Post by v.sorroche » 04 Apr 2018 14:43
Code: Select all
void main()
{
uart1_init(9600);
ddra.B0=1;
porta.B0=0;
while(1)
{
if(uart1_data_ready()==1)
{
if(uart1_read()=='a')
{
porta.b0=!porta.b0;
}
}
}
}
#3 Post by v.sorroche » 05 Apr 2018 13:07
#4 Post by niman » 11 Apr 2018 00:06
Code: Select all
if (UART1_Tx_Idle() == 1)
{
UART1_Write('(');
UART1_Write('a');
UART1_Write(')');
}
Code: Select all
if(UART1_Data_Ready())
{
chk = UART1_Read();
if(chk=='(')
{
UART1_Read_Text(txt,")",2); // reads text until 'enter' is found
if (txt=='a')
{
your code;;;;;;;
}
delay_ms(100);
}
}
Return to “mikroC PRO for AVR General”