How to read logic signal?

Thread Starter

moorejohn90

Joined Dec 9, 2011
57
Hi, I know the way of reading digital signal with button (using pull-down resister with digitalRead) in arduino. Is there any way of reading logic signal from another digital pin of arduino or from other IC that can create logic signal something like TTL (pin 0,1 in arduino).
Thanks
 

MrChips

Joined Oct 2, 2009
30,810
You make no sense to me. Maybe someone else can figure this out or maybe you can rephrase your question.

If it is already a digital signal why not just connect it to a digital input on the arduino?
 

Thread Starter

moorejohn90

Joined Dec 9, 2011
57
Hi, I mean, I can read the input of digital signal(using pull down resister with button) with digitalRead function in arduino. I want to know it is also read digital signal signal (5v or 0v) that are sending from another pin of arduino. Something like read the changing stage of electric signal (0v or 5v) of pin 3 from pin4.
Thanks.
 

mcgyvr

Joined Oct 15, 2009
5,394
yes its the same thing as reading a button..
BUT why? There is no need to read a digital signal from one pin to another because you already know if its high or low (5V or 0V) because you tell that pin to go high or low in the software.

Its like raising your hand then having your other hand make sure your hand is raised.. No point...your brain knows it raised a hand already.
 

Thread Starter

moorejohn90

Joined Dec 9, 2011
57
Hi, I asked the way of doing as I said before, because I want to receive signal from opto-transitor and normal transistor from arduino.
Thanks:p
 

Thread Starter

moorejohn90

Joined Dec 9, 2011
57
Hi t06afre, that right, but I want to receive from another pin of arduino, not from supply voltage through button. And I also want to receive signal(on or off' Voltage) from photo-transistor or other types of transistor.
 

takao21203

Joined Apr 28, 2012
3,702
Hi t06afre, that right, but I want to receive from another pin of arduino, not from supply voltage through button. And I also want to receive signal(on or off' Voltage) from photo-transistor or other types of transistor.
Digital I/O is sometimes used to power small sub-circuits, so why not read it back as well? There is some margin regards the H/L levels.
 

t06afre

Joined May 11, 2009
5,934
If one pin of the Arduino is defined as an output. And one or more pins are defined as inputs. It is nothing wrong in connecting these inputs to the latter output. However the most easy thing would be to just check the stutus of the output pin by reading the output register for that port. I do not use Arduino so I do not know this is done in a program
 
Top