0

I have GPIO to USB adaptor. There is a small light connected to the USB end. I have 4 TTL cables Red, Black, Green and White. By black cable is in pin 6 (ground), white in pin 8 and green in pin 10. I wrote a script to control the GPIO14 and GPIO15, but the light is not switching on. It does switch on when I connect red wire to 3v3 power or 5v power but I read that individual GPIO ports do provide 3v3 power, but how do I make it work? Maybe I need a transistor to turn on and off an USB if it is a serial cable? or some other equipment?

import RPi.GPIO as io
import time

io.setmode(io.BCM)
io.setwarnings(False)

ioG = [14, 15] #14 - white / 15 - Green

io.setup(ioG, io.OUT)
io.output(ioG, True)
print "LED on"

time.sleep(5)

io.output(ioG, False)
print "LED off"

io.cleanup()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.