Set Arduino pin to High Impedance (floating)

Discussion in 'The Projects Forum' started by sirch2, Jan 28, 2013.

  1. sirch2

    sirch2 Thread Starter Active Member

    Joined:
    Jan 21, 2013
    Messages:
    907
    Location:
    Westmorland, UK
    The circuit shown below is for a 40kHz ultrasonic rangefinder. I have put together a variation of the circuit using an Arduino and not including the I2C code/connector (the original code is in Assembly with which I am not too familiar so I am rewriting it).

    The reciever section includes 4 Op Amps, the middle two of which are supposed to provide selectable gain. I am assuming that I need to toggle the resistsors from High Impedance to Low (ground) to change the gain and I can set the relevat pins to OUTPUT, LOW to ground them.

    My question is how do I set the pins back to floating in on the Arduino? Would it be enough to set it to HIGH?

    [​IMG]
  2. MrChips

    MrChips Moderator Staff Member

    Joined:
    Oct 2, 2009
    Messages:
    11,548
    There is a register called DDRA. Set this to 0 to set all pins of PORTA to high impedance.
    Specifically, set the corresponding bit to 1 that you wish to be an output.
Similar Threads
Forum Title Date
The Projects Forum Arduino High Power LED Jun 4, 2012
The Projects Forum Quadcopter project using Arduino Apr 22, 2015
The Projects Forum Bipolar stepper motor 2-wire vs 4-wire control with H-Bridge? Arduino UNO R3 Apr 21, 2015
The Projects Forum 4 X 4 x 4 LED Cube with Arduino Apr 14, 2015
The Projects Forum Controlling Electromagnet Strength with Arduino Apr 11, 2015

Share This Page