Can I connect a digital port directly to another on the same Arduino (e.g.: connecting D2 to D13) without an external circuit? If not, how can I make this connection? Thank you.
I suppose you could make a sort of "soft link" by reading say pin 2 and writing that to pin 13, so pin 13 would always "reflect" pin 2.
Something like:
Read(digitalWrite (13, digitalRead(2));
But what are you trying to do?
I'm trying to simulate a signal of 100us in a digital pin, to test my program (that need to count how much signals of high- lwo - high are in a digital pin).
You can just connect the two pins with a wire if you're confident you will never set them both to outputs with different levels.
As a safety precaution connect them with a resistor, something around 150R should be safe, that will limit any current to 33mA should you get the programming wrong.
Rob
Graynomad:
You can just connect the two pins with a wire
It's not 100% clear, but wouldn't that go against this requirement:
without an external circuit
hmmm, good point.
Rob