go_away

Author Topic: Axon interface Linux  (Read 1885 times)

0 Members and 1 Guest are viewing this topic.

Offline taba93Topic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Axon interface Linux
« 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 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

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Axon interface Linux
« Reply #1 on: November 15, 2009, 08:52:33 PM »
Quote
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:

Code: [Select]
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

Offline awally88

  • Robot Overlord
  • ****
  • Posts: 212
  • Helpful? 0
Re: Axon interface Linux
« Reply #2 on: November 15, 2009, 11:13:30 PM »
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!

Offline Commanderbob

  • Robot Overlord
  • ****
  • Posts: 146
  • Helpful? 2
  • Embeddedmicro.com
Re: Axon interface Linux
« Reply #3 on: November 27, 2009, 04:55:33 PM »
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
« Last Edit: November 27, 2009, 05:01:28 PM by Commanderbob »

 


Get Your Ad Here

data_list