Society of Robots - Robot Forum
Software => Software => Topic started by: hendrachubby on October 12, 2009, 05:26:18 PM
-
Hi all,
i can send data to PC but i can't send data to PC, here is my program :
#pragma used+
char recieve_serial_2(void)
{
char status,data;
while (1)
{
while (((status=UCSR2A) & RX_COMPLETE)==0);
data=UDR2;
if ((status & (FRAMING_ERROR | PARITY_ERROR | DATA_OVERRUN))==0)
return data;
};
}
#pragma used-
for testing i try to send a char to toggle my PORT and turn on a LED but it still not working, like this :
while (1)
{
if (recieve_serial_2() == A)
{
PORTD.5 = 1;
}
}
thx all for the help
-
Hi all,
i can send data to PC but i can't send data to PC, here is my program :
...
...
You might wanna rephrase that?
-
ooh im sorry,
i can send data to my PC
but i can't send data from my PC to uC