Last active
December 27, 2020 09:03
-
-
Save alexesDev/5abc62123f364a59320e8c2d86a504c2 to your computer and use it in GitHub Desktop.
FF2232 in BitBang with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylibftdi import BitBangDevice, Bus | |
import time | |
with BitBangDevice() as bb: | |
bb.baudrate = 60 | |
bb.direction = 0xFF | |
bb.port = 0x00 | |
i = 0 | |
while True: | |
bb.port ^= (1 << i); | |
i = (i + 1) % 8 | |
time.sleep(0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylibftdi import BitBangDevice, Bus | |
import time | |
with BitBangDevice() as bb: | |
bb.baudrate = 60 | |
bb.direction = 0xFF | |
bb.port = 0x00 | |
i = 0 | |
dir = 1 | |
while True: | |
bb.port ^= (1 << i); | |
i += dir | |
if i == 8: | |
dir = -1 | |
i -= 1 | |
if i == -1: | |
dir = 1 | |
i += 1 | |
time.sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment