Society of Robots - Robot Forum

Software => Software => Topic started by: Admin on September 29, 2009, 11:35:08 AM

Title: sample code to convert Axon into USB to serial adapter
Post by: Admin on September 29, 2009, 11:35:08 AM
If you don't own a USB to serial adapter and you need one, just program this into your Axon.

Throw it into control.h somewhere. Make sure you defined baud rates correctly!

Code: [Select]
int tempbyte;
while(1)
{
tempbyte=uart0GetByte();//get a single character
if (tempbyte!=-1)//if data recieved
uart1SendByte(tempbyte);//send a byte
tempbyte=uart1GetByte();//get a single character
if (tempbyte!=-1)//if data recieved
uart0SendByte(tempbyte);//send a byte
}