I want to connect a 100k resistor to a device but I want to use Teensy3.2 to switch the other end of it from GND, to open circuit, to 5 volt.
I was thinking to simply connect it to a pin and control as below.........wondering if that would work or be reliable.????
pinMode( pinNumber, OUTPUT ); // set as output
digitalWrite( pinNumber, LOW ); // set pin low
// code here to do something when pin is low
pinMode( pinNumber, INPUT ); // now set tri-stated.?.....Is this same as opencircuit or at least very high impedance well in access of 100k..??
//code here to do something when pin is open circuit
pinMode( pinNumber, OUTPUT ); // and set back to output
digitalWrite( pinNumber, HIGH ); // set pin high
//code here to do something when pin is high
...............................................................................................
Got this below from a search on the forum..................
That's why newer chips like the ARM chips from Freescale have a special disable mode, which is the default.
On AVR, the pins with ADC inputs also have a special disable mode. However, it's not the default. When you use analogRead(), the pin you're reading is placed in that mode (this is a Teensyduino feature - Arduino's version of analogRead does not do this) to prevent that pin you're using for analog voltages from consuming extra power. On Teensy 2.0, only the pins with analog input have this digital input disable feature
.................................................................................................
....................What command is used to set to disable mode ??...
I was thinking to simply connect it to a pin and control as below.........wondering if that would work or be reliable.????
pinMode( pinNumber, OUTPUT ); // set as output
digitalWrite( pinNumber, LOW ); // set pin low
// code here to do something when pin is low
pinMode( pinNumber, INPUT ); // now set tri-stated.?.....Is this same as opencircuit or at least very high impedance well in access of 100k..??
//code here to do something when pin is open circuit
pinMode( pinNumber, OUTPUT ); // and set back to output
digitalWrite( pinNumber, HIGH ); // set pin high
//code here to do something when pin is high
...............................................................................................
Got this below from a search on the forum..................
That's why newer chips like the ARM chips from Freescale have a special disable mode, which is the default.
On AVR, the pins with ADC inputs also have a special disable mode. However, it's not the default. When you use analogRead(), the pin you're reading is placed in that mode (this is a Teensyduino feature - Arduino's version of analogRead does not do this) to prevent that pin you're using for analog voltages from consuming extra power. On Teensy 2.0, only the pins with analog input have this digital input disable feature
.................................................................................................
....................What command is used to set to disable mode ??...