Society of Robots - Robot Forum
Software => Software => Topic started by: taba93 on November 15, 2009, 10:32:41 AM
-
Hi,
I am creating a robot that has a normal computer on it (and the operating system that works on it is Ubuntu).
This small computer is attached to the Axon Microcontroller and on this microcontroller I would like to connect the Sabertooth 2x10 Motor Controller and some sensors like temperature and IR sensors.
The problem is the following: I can load a program to this microcontroller thanks to this guide: http://www.societyofrobots.com/robotforum/index.php?topic=8216.msg63998#msg63998 (http://www.societyofrobots.com/robotforum/index.php?topic=8216.msg63998#msg63998) but I would like to write a program (in C) on my computer that can send some impulses to the Sabertooth to make them work and that can receive the data from the sensors. Is it possible or how can I do a similar thing?
Thank you for your help!
Byebye
-
I would like to write a program (in C) on my computer that can send some impulses to the Sabertooth to make them work and that can receive the data from the sensors. Is it possible or how can I do a similar thing?
For the Axon end, just put some code on that looks like this:
char temp;
temp=uart1GetByte();//returns -1 if no data present
if (temp == r)//if data received
do_stuff();
So now your computer just needs to send letter/number commands and receive data, too. I don't use Linux so can't help you, but this might:
http://www.faqs.org/docs/Linux-mini/IO-Port-Programming.html (http://www.faqs.org/docs/Linux-mini/IO-Port-Programming.html)
-
If you do get some good serial routines running under *nix / Ubuntu you should post them up! I've done a bit of playing with the Axon under Ubuntu but I normally reboot into windows to get stuff working :( If you get a good serial comms programming running that would be awesome!
-
I had someone write a program for me that interfaced with an AVR. The code sets up a serial port and then sends data over it, however it never receives it. You can check out what it does [youtube]F0Nq_V9VGqc[/youtube]
It runs on Linux (Ubuntu in my case) and it may be of some help. Check out the serial.c file.
JR