Society of Robots
     | Robot Forum | Robot Tutorials | Robot FAQ |
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 20, 2009, 10:03:26 PM

Login with username, password and session length
Search:     Advanced search
Sept 30th - The 5th SoR Robot contest is now open! Win an Axon II!

Robot Forum
72,667 Posts in 9,267 Topics by 5,292 Members
Latest Member: lepomis
* Home Help Help Login Register
0 Members and 1 Guest are viewing this topic.
Pages: [1] Print
Author Topic: sample code to convert Axon into USB to serial adapter  (Read 157 times)
AdminTopic starter
Administrator
Supreme Robot
*****

Helpful? 62
Online Online

Posts: 8,610



View Profile WWW
« on: September 29, 2009, 10: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:
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
have C++ serial code?
Software
benji 12 1762 Last post December 11, 2007, 05:42:00 AM
by reSpawn
Serial Uart Passthru code
Software
Asellith 3 879 Last post January 04, 2008, 05:54:05 AM
by GUmeR
cheap bluetooth serial adapter
Misc
Trumpkin 5 1178 Last post December 19, 2007, 07:40:56 AM
by Trumpkin
SSC-32 with Prolific USB to Serial Adapter
Electronics
SeagullOne 0 73 Last post October 26, 2009, 02:54:57 PM
by SeagullOne
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!


Advertise on this Forum