Society of Robots - Robot Forum

Software => Software => Topic started by: spizzak on July 12, 2009, 03:46:25 PM

Title: Print Statements
Post by: spizzak on July 12, 2009, 03:46:25 PM
Hey everyone, I'm trying to troubleshoot my system and was wondering if there is anyway to have the robot send data back to the computer while its running

For example what I'm thinking of doing for my $50 robot is to have the photoresistors send back the readings to the computer so I can actively monitor it as I move the robot around.

Also, is there a way to do print statements?
Title: Re: Print Statements
Post by: kpmcgurk on July 12, 2009, 03:58:25 PM
Ya using the printf() function along with uarts and hyperterminal... let me get you the links

read these in order!!

http://www.societyofrobots.com/microcontroller_uart.shtml (http://www.societyofrobots.com/microcontroller_uart.shtml)
http://www.societyofrobots.com/programming_printf.shtml (http://www.societyofrobots.com/programming_printf.shtml)
http://www.societyofrobots.com/microcontroller_uart_50_robot.shtml (http://www.societyofrobots.com/microcontroller_uart_50_robot.shtml)
Title: Re: Print Statements
Post by: spizzak on July 12, 2009, 04:17:26 PM
So where is it supposed to display when I call the printf?
Title: Re: Print Statements
Post by: SmAsH on July 12, 2009, 04:26:30 PM
it will display it in hyperterminal. start>all programs>accessories>communication>hyperterminal.
you will need to make/buy an RS232 shifter so you can connect your mcu to a usb or serial connection.
like one of these http://www.sparkfun.com/commerce/product_info.php?products_id=133 (http://www.sparkfun.com/commerce/product_info.php?products_id=133)
(http://www.sparkfun.com/commerce/images/products/Shifter-0.jpg)
Title: Re: Print Statements
Post by: kpmcgurk on July 12, 2009, 04:58:16 PM
or bluetooth i you want to spend the money (and chicks dig wireless  ;) )
Title: Re: Print Statements
Post by: Kirk on July 20, 2009, 10:45:32 PM
As it has been said read the SoR tutorials.

I had trouble understanding all the various printing libraries and commands and how to choose and why.  So here is my 2cents.
 
The rprintf command recommended in the tutorial is my choice.  It stands for ReducedPrintFormated. The more common printf command is designed to everything including printing the kitchen sink. rprintf is geared towards the microprocessor with smaller memory use and a little less power.  I have never needed more power than it provides.

rprintf is part of the avrlib library set. 

I have another post on trying to get rprintf to work with an LCD (which I am told works)
Kirk