Interference with perifierals using c++

i want to control the electrical devices(fan ,bulb etc.)connecting with the computer using output ports of the comuter in using c++ language.But the difficulty is that how can i control the output ports of computer using c++?how the address of output port can be found?Send me the source code of program which will control brigtness of the bulb connected to the output ports of computer.


Share Send to a friend Watch Report
 
 

Posted Answers

Order by
 
7 thumbs up

don't be silly, you can do anything in any language you like. You could do it in visual basic if you wanted.  You have to interface with a device driver, or you can write directly to some output address if you want.  If you on a linux host open a correctly mapped "/dev/something" device and write to it, but you'll have to write something the hardware understands... it's your light bulb that must be hooked to some kind of addressible variable resistor that will adjust it's brightness based on some digital signal, or the contents of some buffer.  In order for an 'address' to make a difference, it has to be using Memory mapped I/O, so if for example you're using the serial port, and you have a controller on the serial port between your machine and the light bulb, you can open up the port's /dev/ttySx device and send data to it... but you cannot hook up just a device that doesn't have any controller to accept digital signals as valid input and expect to control it no matter what device you're working with.  In windows, use the win32 api to write to the serial port using, of all things, the serial driver, and in linux, open the device and fire away.  It has nothing to do with the language at all.


Posted 1 year ago ( permalink )
In reply to jatinder's question
dave.dolan was invited by Yedda to answer this question.

Rated as
Best Answer
0
2

Helpful?

line
line
line



 

Oh My God!Tongue out

Just the fact that you could answer this person's question in such detail is incredible. Your awesome. 

P.S. why would anyone want to do this with his/her fan or light bulb anyway?  KymCool


Posted 5 months ago ( permalink )
In reply to jatinder's question
Rated as
#2 out of 2
0
0

Helpful?

line
line
line



Sign in to participate

Got an answer for jatinder? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Audio configuration

i am trying to open a music system but i cant open it because my computer says i have an audio configuration...what does this mean ...
Submitted by babello87 2 years ago
  • viewed 2505 times

Last answer posted 10 months ago by lilqueenie


Conver tojpg file

How do I convert a pdf file to jpg?
Submitted by lindacop166 4 months ago
  • viewed 219 times

Last answer posted 4 months ago by cwhaley


What is the smallest pc with a power full cpu ?

what is the smallest pc with a power full cpu ?
Submitted by samz 11 months ago
  • viewed 362 times

Last answer posted 11 months ago by rofe



» More...

Explore Related Posts in Forums

C drive missing from "My Computer"

and got them back but now the c drive icon is missing from the "My Computer" window and I don't know how to get it back. So is there anyway to get the c drive to show up in the My Computer window again

My C: drive access gone in My Computer!

in the C; Drive on/in My Computer being seen..still "stealth". I have win. XP Pro and all my drives display except C: (My Maxtor hard drive). Went into control

Computer Is Slow And Out Of Space On C:

My computer has a c: and an e: drive (external back up). My c: drive is only 40 gig and my e enough to know what else can be moved there to free up space on c: I am sure that is why my computer
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog
Copyright © 2006-2008, Yedda Inc. and respective copyright owners · CC License