Click here to Skip to main content
13,358,478 members (55,130 online)
Rate this:
Please Sign up or sign in to vote.
i want to learn how can i use my computer as a mind of a system like robot or etc.
or use of mini-computer boards that have possiblity to run operating systems seems linux.

i searched a lot for it but i didnt success to find good results.

may anyone helps me?
Posted 23-Feb-13 22:00pm
Sandeep Mewara 24-Feb-13 3:42am
how can i use my computer as a mind of a system like robot or etc.
Elaborate. Looking for Artificial Intelligence?
hor_313 24-Feb-13 7:52am
more !
i am looking for using computer in control systems, from a simple controller to an advanced robot . but now my concentration is on port programming(com , usb , lan , wi-fi? , bluetooth? etc.)with c or c++ in ubuntu.

i am looking for a way to send\receive data from a computer ports
hor_313 24-Feb-13 8:00am
i.e. connecting to a serial driver motor and turning on/off it or other controls . or send/receive PWM pulses or connecting another microcontrollers with I2C or SPI or other protocols.

recently new mini-computers has many ports and ARM processors that has possibility to run linux or other operation systems.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I think you are looking at the problem the wrong way. You are asking software questions when you should be thinking hardware.

The Raspberry Pi computer (generally linux) has the GPIO, I2C and other ports you are talking about. These are not generally available on standard PC machine hardware. I have recently made myself at home in this world. Have a look at the Raspberry Pi forums here[^]. A helpful library can be found here[^].

P.S. You flagged "Ubuntu" in your message. The Raspberry Pi is linux, but not Ubuntu. I assume that is not a problem. If you were strictly searching for an Ubuntu solution, that may have limited availability of answers.
hor_313 25-Feb-13 9:17am
Is anything like PI but with c++ language?
H.Brydon 25-Feb-13 14:01pm
If you are asking if the Raspberry Pi supports C++ ... yes. It supports most (perhaps all?) versions of C++ that are available on x86 linux machines.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You usually don't connect directly I/Os to the PC. Instead you connect the PC (via a virtual COM over USB, for instance) to a microcontroller[^], the latter, in turn, handles directly the I/Os.
hor_313 24-Feb-13 16:51pm
if i have known your mean you say we have 2ways to hardware programming . in PC's indirectly and in microcontrollers directly .
yes i know that but now i want to learn how can i use PC's ports to controll an external device ?

i have seen some examples about that uses <asm io.h=""> headers in C programming or such as it . but that header don't work in ubuntu.

a am looking something about that examples with direct access to my ports , first my serial port then others.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your question is too generic to get a good answer. If you want to program IO on a computer, then it depends what IO you are referring to (I noticed you mentioned com, usb, network, bluetooth, etc). Each method has it's own standards and methods that are commonly used. Communicating via a network is probably the best place to start since it's a widely used method.

Use sockets to communicate via a network (TCP/IP is probably a good place to start):[^][^]
hor_313 24-Feb-13 16:55pm
so thanks for answer but im seeking a serial programming example or tutorial in ubuntu linux .

cause i think its very commonly to use serial ports in this situation(port programming )

i.e. there are many converter for rs-232 from USB or other ports and the many of devices or motors or etc have com port or to-com-converter
Albert Holguin 25-Feb-13 11:21am
Your question is really badly phrased.. so I tried to interpret based on your comments, in which you talk about networking. Anyway, there's a ton of articles about programming with serial ports out there, just search google for articles.
hor_313 25-Feb-13 13:19pm
Oh! you destroyed my hope in leaning English :(

I said that I think RS232(a type of serial port) is most commonly and also there are many converter such as USB t0 RS232 or vice versa for it and seems it's good for Start.
Albert Holguin 25-Feb-13 15:36pm
Like I said, there's a ton of resources on serial programming on the net. It used to be very popular back in the day so there's a ton of resources online. It's probably not as popular as you may think now though (specially the RS232 standard), hence most new computers not having a com port, but it's still quite usable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100