yesterday I tried a usb->gpio board, basically it turned my high end PC into a raspberry pi.
But :
I tried to make a 5Khz PWM with a 20% duty cycle, it did not go well, my scope could not lock onto the signal because each period was different, I'm guessing this is due to usb lag.
ex of program used :
Code: Select all
def makePwm20Percent5KhzPeriod(pin_number):
# 5Khz = 0.0002 seconds periods, here making a 20% pwm
ft232h.output(pin_number, GPIO.HIGH)
time.sleep(0.00004)
ft232h.output(pin_number, GPIO.LOW)
time.sleep(0.00016)
FT232H.use_FT232H()
ft232h = FT232H.FT232H()
C0_PIN = 8
ft232h.setup(C0_PIN , GPIO.OUT)
while True:
makePwm20Percent5KhzPeriod(C0_PIN)
Thanks.