Hi,
it may be obvious for some or most of you.. but it wasn't for me:
You can use a pin, if it is in "Open Drain" mode (aka "open collector") as in- and output at the same time.
To test ist, connect a resistor, some kOhm (I tried it with 1K) with PIN 0, and the other end with GND or 3.3Volt.
You'll see the "0" and "1" in the serial monitor.
Not, of course, if you digitalWriteFast(0,0);
Perhaps this info is useful for others too (who did not know this, like me).
This is useful for some buses.
it may be obvious for some or most of you.. but it wasn't for me:
You can use a pin, if it is in "Open Drain" mode (aka "open collector") as in- and output at the same time.
Code:
void setup() {
pinMode(0, OUTPUT_OPENDRAIN);
digitalWriteFast(0,1);
}
void loop() {
Serial.println(digitalReadFast(0));
delay(250);
}
You'll see the "0" and "1" in the serial monitor.
Not, of course, if you digitalWriteFast(0,0);
Perhaps this info is useful for others too (who did not know this, like me).
This is useful for some buses.
Last edited: