there are TX0,RX0,TX1,RX1,TX2,RX2,TX3,RX3
how will be the UART coding if i want to use TX0 and RX0 to connect with SKPS?
I found this in cytron tutorial but i'm not sure whether suit to my project or not.
- CODE: SELECT_ALL_CODE
unsigned char receive_data(void) //Function to wait for a byte receive from UART
{
unsigned char temp;
while(!Serial.available()); //Wait until data received
temp=Serial.read();
return temp; //Return the received data
}
unsigned char skps(unsigned char data) //Function to send out a byte via UART
{
Serial.write(data); //Send new data
return receive_data(); //Return received data
}