import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
 
ADC.setup()
 
from time import sleep
pinos = [16, 21, 22, 13, 12, 11]
 
for pino in pinos:
    GPIO.setup("P9_" + str(pino), GPIO.OUT)
 
while True:
    for pino in pinos:
        GPIO.output("P9_" + str(pino), GPIO.HIGH)
        tempo = ADC.read('P9_39')
        print tempo
        sleep(tempo)
        GPIO.output("P9_" + str(pino), GPIO.LOW)