DMX4PI
Convert your Raspberry Pi into a DMX controller. This requires a minimum of additional hardware and utilises the fancy-pancy DMA features of the Raspberry Pi to meet the strict timings of the DMX512 protocol. Under the hood this library uses pigpio.
Installation
Beside a running Node v4 or newer you require some dependencies:
Command for Raspbian:
sudo apt install build-essential python pigpio
Example + API
Well, calling these few methods API is kind of overexaggerated ;) The following example will show you all methods offered by the API.
// We must run this as root since we are accessing hardware directly.// Furthermore just one instance of this driver is allowed per Pi concurrently.// Load and configure the drivers:const DMX =// Any free GPIO can be used:pinTx: 22 // Data pinpinEn: 27 // Enable ping// The signal levels can be inverted if neccessary:invTx: true // Data pininvEn: true // Enable pin;{// Stop when channel 3 reached 255if ch3 > 255 return;// Create buffer that will be transmitted: Ch 1, 2, 4, 5 are static and Ch 3 is fadedlet data = Buffer;// DMX.transmit( data ) returns a promise that is fulfilled if the data has been transmittedreturn DMX;}// Start fading and shutdown the driver when fading has been finished;
Hardware
Will be described in the near future.