Új hozzászólás Aktív témák

  • tvamos

    nagyúr

    Sziasztok!
    Irtam 4 kis programreszletet, es az utolso nem mukodik, nem ertem, hogy pontosan miert.
    led_brightness = 0, 1, 2, 4, 8, 18, 41, 93, 211, 479, 1088, 2469, 5604, 12721, 28873, 65535
    for y in range(256):
        print (y*257)
        pca.channels[7].duty_cycle = y*257
        time.sleep (0.001)
    for y in range (65535, -1, -16):
        print (y)
        if y>=0:
            pca.channels[7].duty_cycle = y
        else:
            pca.channels[7].duty_cycle = 0
        time.sleep (0.001)
    for y in led_brightness:
        print (y)
        pca.channels[7].duty_cycle = 65535-y
        time.sleep (1)
    for y in range (led_brightness, 0, -1):
        print (y)
        pca.channels[7].duty_cycle = 65535-y
        time.sleep (1)
    El tudnatok magyarazni? Illetve hogy oldanatok meg a problemat?

Új hozzászólás Aktív témák