summaryrefslogtreecommitdiff
path: root/src/scanout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scanout.c')
-rw-r--r--src/scanout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scanout.c b/src/scanout.c
index 1c5823b..49c6b6b 100644
--- a/src/scanout.c
+++ b/src/scanout.c
@@ -43,7 +43,8 @@ int scanout_all(struct nanolight *nl)
int j;
struct fixture *fix = &nl->fixtures[i];
for ( j=0; j<fix->cls->n_attrs; j++ ) {
- int pos = fix->base_addr + fix->cls->attrs[j].addr_offset;
+ /* Minus one to convert DMX address to indexing in 'dmx' array */
+ int pos = fix->base_addr + fix->cls->attrs[j].addr_offset - 1;
if ( fix->cls->attrs[j].props & ATTR_16BIT ) {
dmx[pos] = (fix->attr_vals[j] & 0xff00) >> 8;
dmx[pos+1] = fix->attr_vals[j] & 0xff;