diff options
author | Thomas White <taw@physics.org> | 2020-06-07 19:13:10 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-06-07 19:13:10 +0200 |
commit | d0754c97ad7bd3d6d1acc39ce2dfb73db8fb217e (patch) | |
tree | 97e150d7f021a02fc1669d697538f6b00dbc949f /guile/nanolight/fixture.scm | |
parent | dbe7943b1b1267aaa5a92821236055a7b61f04a0 (diff) |
Add 16-bit values, and add example fixture class
Diffstat (limited to 'guile/nanolight/fixture.scm')
-rw-r--r-- | guile/nanolight/fixture.scm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/guile/nanolight/fixture.scm b/guile/nanolight/fixture.scm index 0c67975..9bfa3d9 100644 --- a/guile/nanolight/fixture.scm +++ b/guile/nanolight/fixture.scm @@ -7,7 +7,7 @@ #:export (<fixture> <fixture-attribute> make-output patch-fixture fixture-string fixture-address-string - percent->dmxval chan + percent->dmxval msb lsb chan start-addr universe assign-attr!)) @@ -133,6 +133,11 @@ (define (percent->dmxval val) (round-dmx (/ (* 256 val) 100))) +(define (msb val) + (round-dmx (/ val 256))) + +(define (lsb val) + (round-dmx (logand (round val) #b11111111))) (define (chan channel start-addr) (- (+ channel start-addr) 1)) |