Skip to content

Instantly share code, notes, and snippets.

@mntmn
Created December 13, 2017 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mntmn/03726c69d9ef2eefb6dcb9c53d0fa504 to your computer and use it in GitHub Desktop.
Save mntmn/03726c69d9ef2eefb6dcb9c53d0fa504 to your computer and use it in GitHub Desktop.
set s1r 0
set s1g 0
set s1b 0
proc updateStrip {} {
global s1r s1g s1b
puts "$s1r $s1g $s1b"
exec nc -u 192.168.7.2 3333 -c "echo 3/1/$s1r/$s1g/$s1b"
exec nc -u 192.168.7.2 3333 -c "echo 2/1/$s1r/$s1g/$s1b"
}
proc setR {val} {
global s1r
set s1r $val
updateStrip
}
proc setG {val} {
global s1g
set s1g $val
updateStrip
}
proc setB {val} {
global s1b
set s1b $val
updateStrip
}
scale .scaleR -orient vertical -length 600 -width 100 -from 0 -to 255 \
-tickinterval 50 \
-command "setR"
scale .scaleG -orient vertical -length 600 -width 100 -from 0 -to 255 \
-tickinterval 50 \
-command "setG"
scale .scaleB -orient vertical -length 600 -width 100 -from 0 -to 255 \
-tickinterval 50 \
-command "setB"
grid .scaleR -row 0 -column 0
grid .scaleG -row 0 -column 1
grid .scaleB -row 0 -column 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment