Datasheet

# Create an FT232H object that grabs the first available FT232H device found.
ft232h = FT232H.FT232H()
Now an FT232H object is created and assigned to the ft232h variable. This will detect the first available FT232H device
connected to the computer and initialize its MPSSE for use with GPIO.
Make sure the use_FT232H() function was previously called or else this function will fail!
# Configure digital inputs and outputs using the setup function.
# Note that pin numbers 0 to 15 map to pins D0 to D7 then C0 to C7 on the board.
ft232h.setup(7, GPIO.IN) # Make pin D7 a digital input.
ft232h.setup(8, GPIO.OUT) # Make pin C0 a digital output.
Next the setup() function is called on the FT232H object. This function takes two parameters, the first is the pin number and the
second is either GPIO.IN or GPIO.OUT to set the pin as a digital input or output.
Remember the pin numbers are 0 to 7 for D0 to D7, and 8 to 15 for C0 to C7.
# Loop turning the LED on and off and reading the input state.
print 'Press Ctrl-C to quit.'
while True:
# Set pin C0 to a high level so the LED turns on.
ft232h.output(8, GPIO.HIGH)
# Sleep for 1 second.
time.sleep(1)
# Set pin C0 to a low level so the LED turns off.
ft232h.output(8, GPIO.LOW)
# Sleep for 1 second.
time.sleep(1)
Now an infinite loop is entered and the LED is turned on and off using the output() function on the FT232H object. This function
takes two parameters, the first is the pin number and the second is GPIO.HIGH/True to set the pin to a high level (3.3 volts), or
GPIO.LOW/False to set the pin to a low level (ground).
# Read the input on pin D7 and print out if it's high or low.
level = ft232h.input(7)
if level == GPIO.LOW:
print 'Pin D7 is LOW!'
else:
print 'Pin D7 is HIGH!'
Finally the digital input is read using the input() function on the FT232H object. This function takes one parameter, the pin
number to read. The function will return GPIO.LOW/False if the input is at a low level (below about 0.8 volts), and
GPIO.HIGH/True if the input is at a high level (above about 0.8 volts, up to 5V max).
That's all there is to use GPIO on the FT232H board! You can use these GPIO pins to turn on and off devices or LEDs, or read
switches or pins from other chips.
Be aware that the output pins on the FT232H are only designed to source a few milliamps of current (up to about 16mA per pin).
If you need to drive devices that take a lot of current, look into using transistors to switch higher amounts of current.
© Adafruit Industries https://learn.adafruit.com/adafruit-ft232h-breakout Page 26 of 36