Hi all,
I need to control a device that has a wire.
So, I configure as the following :
it works like a charm. But... When the Teensy module is powered off, it puts its "PIN" to almost GND. So my device turns on
The question is : Is there a way to change this behaviour ?!
Thanks.
I need to control a device that has a wire.
- If the wire is not connected (open drain), the device is OFF.
- If the wire is put to its GND, the device is ON.
So, I configure as the following :
Code:
#define PIN 4
void setup() {
digitalWrite(PIN, HIGH); // Turn off the device
pinMode(PIN, OUTPUT_OPENDRAIN); // Set the pin as output opendrain
}
void enableDevice(bool on) {
digitalWrite(PIN, !on);
}
it works like a charm. But... When the Teensy module is powered off, it puts its "PIN" to almost GND. So my device turns on
The question is : Is there a way to change this behaviour ?!
Thanks.