Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
55c5a2ac
Commit
55c5a2ac
authored
11 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Patches
Plain Diff
Simple Tk UI for setting firmware configuration flags
parent
89351c5a
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
tools/firmware-config-ui.py
+43
-0
43 additions, 0 deletions
tools/firmware-config-ui.py
with
43 additions
and
0 deletions
tools/firmware-config-ui.py
0 → 100755
+
43
−
0
View file @
55c5a2ac
#!/usr/bin/env python
#
# Simple UI for firmware configuration flags.
# Talks to an fcserver running on localhost.
#
# Micah Elizabeth Scott
# This example code is released into the public domain.
#
import
Tkinter
as
tk
import
socket
import
struct
s
=
socket
.
socket
()
s
.
connect
((
'
localhost
'
,
7890
))
print
"
Connected to OPC server
"
def
setFirmwareConfig
(
data
):
s
.
send
(
struct
.
pack
(
"
>BBHHH
"
,
0
,
0xFF
,
len
(
data
)
+
4
,
0x0001
,
0x0002
)
+
data
)
def
update
():
setFirmwareConfig
(
chr
(
noDither
.
var
.
get
()
|
(
noInterp
.
var
.
get
()
<<
1
)
|
(
manualLED
.
var
.
get
()
<<
2
)
|
(
ledOnOff
.
var
.
get
()
<<
3
)
))
def
check
(
text
):
v
=
tk
.
IntVar
()
w
=
tk
.
Checkbutton
(
root
,
command
=
update
,
variable
=
v
,
text
=
text
)
w
.
var
=
v
w
.
pack
()
return
w
root
=
tk
.
Tk
()
root
.
title
(
"
Fadecandy Firmware Configuration UI
"
)
noDither
=
check
(
"
Disable dithering
"
)
noInterp
=
check
(
"
Disable interpolation
"
)
manualLED
=
check
(
"
Built-in LED under manual control
"
)
ledOnOff
=
check
(
"
Built-in LED manual on/off
"
)
root
.
mainloop
()
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