Can I change PinMode(Output/Input) in main loop? ... Safely?
I am working on a project where I would very much like to have to only use 1 digital pin as an Input and Output, not simultaneously of course. The pin only serves as a notification line, thats all. At some point one teensy will act as a receiver and sometimes a transmitter and the other teensy vise versa.
I will pay close attention to make sure that both wont ever be set as OUTPUTs at the same time.
In the event that both are set to OUTPUT and either one or both set HIGH, what can I do to not destroy those pins? Would a resistors in series help?
Thanks guys
EDITED:
To clarify:
At some point I will want Teensy1 (T1) to be listening to T2, it will be listening to see if T2 has set its pin to HIGH,
but other times I will want T2 to be listening to T1, listening to see if T1 sets its pin HIGH.
They should never be transmitting at the same time. (Pins set to OUTPUTS)
In the event that they do both set their pins to OUTPUTS and HIGH I need to make sure that I don't destroy those pins
I am working on a project where I would very much like to have to only use 1 digital pin as an Input and Output, not simultaneously of course. The pin only serves as a notification line, thats all. At some point one teensy will act as a receiver and sometimes a transmitter and the other teensy vise versa.
I will pay close attention to make sure that both wont ever be set as OUTPUTs at the same time.
In the event that both are set to OUTPUT and either one or both set HIGH, what can I do to not destroy those pins? Would a resistors in series help?
Thanks guys
EDITED:
To clarify:
At some point I will want Teensy1 (T1) to be listening to T2, it will be listening to see if T2 has set its pin to HIGH,
but other times I will want T2 to be listening to T1, listening to see if T1 sets its pin HIGH.
They should never be transmitting at the same time. (Pins set to OUTPUTS)
In the event that they do both set their pins to OUTPUTS and HIGH I need to make sure that I don't destroy those pins
Last edited: