Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bell
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fxk8y
Bell
Commits
17aa519e
Commit
17aa519e
authored
3 years ago
by
fxk8y
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.c3pb.de:fxk8y/Bell
parents
4eac0df5
c0d0cc29
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripting/ftdi.py
+10
-2
10 additions, 2 deletions
scripting/ftdi.py
with
10 additions
and
2 deletions
scripting/ftdi.py
+
10
−
2
View file @
17aa519e
#!/usr/bin/env nix-shell
#!nix-shell -i python -p less -p "python3.withPackages (p: with p; [pyftdi pyyaml])" --pure
import
random
from
time
import
sleep
from
pyftdi.eeprom
import
FtdiEeprom
from
pyftdi.ftdi
import
Ftdi
,
FtdiError
...
...
@@ -41,7 +41,15 @@ ftdi.set_cbus_direction(0b1111, 0b1111)
frame
=
0
while
True
:
ftdi
.
set_cbus_gpio
(
frame
&
0b1111
)
# counter
# ftdi.set_cbus_gpio( frame & 0b1111 )
# random bits
# ftdi.set_cbus_gpio( random.randint(0, 15) & 0b1111 )
# single random bit
ftdi
.
set_cbus_gpio
(
1
<<
random
.
randint
(
0
,
3
)
)
frame
+=
1
sleep
(
0.04
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment