Society of Robots
     | Robot Forum | Robot Tutorials | Robot FAQ |
September 02, 2010, 09:51:25 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: March 18th - Buy an Axon or Axon II, build a great robot, and support SoR.

Robot Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: sample code to convert Axon into USB to serial adapter  (Read 698 times)
0 Members and 1 Guest are viewing this topic.
AdminTopic starter
Administrator
Supreme Robot
*****

Helpful? 110
Offline Offline

Posts: 9,833



View Profile WWW
« on: September 29, 2009, 12:35:08 PM »

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:
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
}
Logged

Pages: [1]
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Serial Uart Passthru code
Software
Asellith 3 1123 Last post January 04, 2008, 07:54:05 AM
by GUmeR
cheap bluetooth serial adapter
Misc
Trumpkin 5 1486 Last post December 19, 2007, 09:40:56 AM
by Trumpkin
SSC-32 with Prolific USB to Serial Adapter
Electronics
SeagullOne 0 353 Last post October 26, 2009, 04:54:57 PM
by SeagullOne
How to convert c code to assembly code
Software
The Big B 5 446 Last post June 11, 2010, 11:38:17 AM
by waltr
Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!


Advertise on this Forum