![](/media/cache/profiles/89a26a363b87a87ac6a94277e841b7f4.50x50_q85.jpg)
Uses *spark d-fuser controller hardware as a USB-DMX interface. Developed for visualising Laurel Pardue’s augmented violin with lights.
Dependencies: DMX mbed spk_oled_ssd1305
Diff: main.cpp
- Revision:
- 7:7f3140672370
- Parent:
- 6:cd5846520ea6
diff -r cd5846520ea6 -r 7f3140672370 main.cpp --- a/main.cpp Wed May 18 15:28:17 2016 +0000 +++ b/main.cpp Fri Jun 17 14:07:40 2016 +0000 @@ -45,6 +45,10 @@ #define kDMX_SPOT_DIMMER 32 - 1 +#define kDMX_PAN 36 - 1 +#define kDMX_TILT_MSB 37 - 1 +#define kDMX_TILT_LSB 38 - 1 + #define kDMX_HAZER_HAZE 128 #define kDMX_HAZER_FAN 129 @@ -161,7 +165,7 @@ if (S1 < threshold) S1 = 0; if (S2 < threshold) S2 = 0; if (S3 < threshold) S3 = 0; - if (S4 < threshold) S4 = 0; + if (S4 < threshold) S4 = 0; } void usbSerialReceive(void) @@ -262,6 +266,8 @@ dmx.put(kDMX_PARCAN_4+kDMX_PARCAN_B, 255); dmx.put(kDMX_PARCAN_4+kDMX_PARCAN_LUMA, 0); + dmx.put(kDMX_PAN, 50); + //// Serial usbSerial.baud(kUSB_BAUD); usbSerial.attach(usbSerialReceive); @@ -307,9 +313,19 @@ if (newBowData) { + // EA = Position, EB = Pressure, EC = On string if (EB < 0) EB = 0; char bowDMX = EB * eMultiplier; - dmx.put(kDMX_SPOT_DIMMER, bowDMX); + if (EC) + { + dmx.put(kDMX_SPOT_DIMMER, bowDMX); + } + else + { + dmx.put(kDMX_SPOT_DIMMER, 0); + } + + dmx.put(kDMX_TILT_MSB, 15 + EA * 50); } // Has the button changed?