Click here to Skip to main content
16,016,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iv connect a light to my circuit and its working so i turn it on and vice versa
but im asking about that ((can i in c# show the status of the light if its on or off ??))
with example please?

thanks
Posted
Comments
Sandeep Mewara 10-Mar-11 7:37am    
Not clear.
CPallini 10-Mar-11 8:15am    
Well, your application controls the relay hence it should know if it is switched ON or OFF.

You can't read the status of a light: it's a consumer of electricity, not a supplier.

You can read switches (and buttons which are switches that don't stay shut). You can read any device which gives an appropriate digital output. But no, you can't read a light.

You can read if it is being powered by an external source if you feed the source into the port. But I don't recommend it - if you get the voltage wrong on the source, you could fry parts of your pc. Better to use a buffer chip - look at the 74 series http://rabbit.eng.miami.edu/info/datasheets/[^] as if you get that wrong you waste a cheap IC instead!
A 74LS32 or 74HCT32 or similar should do the trick.


"thanks for ur answers
but i want my circuit without any types of ics or microships.
can i by c# know if the relay number 1 for example is on 5v stat or is 0v?
or how to know if the device is on or off?"


Suit yourself, it's your PC you are risking, not mine!

Yes you can read the status of the drive line to the relay if it is 0V or 5V.
It may be harder if you are controlling the relay from the same parallel port, though.

Have a look here[^] it may help.
 
Share this answer
 
v2
Comments
netjeeb 10-Mar-11 7:56am    
thanks for ur answers
but i want my circuit without any types of ics or microships.

can i by c# know if the relay number 1 for example is on 5v stat or is 0v
?
or how to know if the device is on or off?
Yes, Search and learn about parallel port programming...
 
Share this answer
 
The good place you can roam around is http://channel9.msdn.com/[^]

Look at the coding for fun section
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900