diff --git a/entec-driver/dmx_usb_module b/entec-driver/dmx_usb_module new file mode 160000 index 0000000..3253e7b --- /dev/null +++ b/entec-driver/dmx_usb_module @@ -0,0 +1 @@ +Subproject commit 3253e7b6ef906ce78e423245925f658cba35530a diff --git a/ola-test/blackout b/ola-test/blackout new file mode 100755 index 0000000..592b67e Binary files /dev/null and b/ola-test/blackout differ diff --git a/ola-test/blackout.cpp b/ola-test/blackout.cpp new file mode 100644 index 0000000..bf77be2 --- /dev/null +++ b/ola-test/blackout.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include + +#include + +using std::cout; +using std::endl; + +int main(int argc, char *argv[]) { +unsigned int universe = 0; // universe to use for sending data +unsigned int i; + +// turn on OLA logging +ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + +// Create a new DmxBuffer to hold the data +ola::DmxBuffer buffer; +// set all channels to 0 +buffer.Blackout(); + +// create a new client and set the Error Closure +ola::StreamingClient ola_client; + +// Setup the client, this connects to the server +if (!ola_client.Setup()) { +cout << "Setup failed" << endl; +exit(1); +} + + + +// send the data to the ola server + +if (!ola_client.SendDmx(0, buffer)) { + cout << "Send DMX failed" << endl; + exit(1); + } + +// close the connection +ola_client.Stop(); +return 0; +} + diff --git a/ola-test/compile-blackout.sh b/ola-test/compile-blackout.sh new file mode 100644 index 0000000..5a68569 --- /dev/null +++ b/ola-test/compile-blackout.sh @@ -0,0 +1 @@ +g++ -I/usr/local/include/libola -L/usr/local/lib -lola -lolacommon -lprotobuf blackout.cpp -o blackout diff --git a/ola-test/compile.sh b/ola-test/compile.sh new file mode 100644 index 0000000..9cb5f3c --- /dev/null +++ b/ola-test/compile.sh @@ -0,0 +1 @@ +g++ -I/usr/local/include/libola -L/usr/local/lib -lola -lolacommon -lprotobuf flash.cpp -o flash diff --git a/ola-test/flash b/ola-test/flash new file mode 100755 index 0000000..f884c65 Binary files /dev/null and b/ola-test/flash differ diff --git a/ola-test/flash.cpp b/ola-test/flash.cpp new file mode 100644 index 0000000..fe1e1bc --- /dev/null +++ b/ola-test/flash.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include + +#include + +using std::cout; +using std::endl; + +int main(int argc, char *argv[]) { +unsigned int universe = 0; // universe to use for sending data +unsigned int i; + +// turn on OLA logging +ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + +// Create a new DmxBuffer to hold the data +ola::DmxBuffer buffer; +// set all channels to 0 +buffer.Blackout(); + +// create a new client and set the Error Closure +ola::StreamingClient ola_client; + +// Setup the client, this connects to the server +if (!ola_client.Setup()) { +cout << "Setup failed" << endl; +exit(1); +} + + + +// send the data to the ola server + +double t = 0.0; +while(1) { + t += 0.1; + buffer.SetChannel(4, (int)(127+128*sin(t))); + buffer.SetChannel(5, (int)(127+128*cos(t/4))); +//for(int j = 0; j < 255; j++) { +if (!ola_client.SendDmx(0, buffer)) { + cout << "Send DMX failed" << endl; + exit(1); + } +usleep(20000); // sleep for 20ms between updates +//cout << "universe " << j << endl; +//} +} + +// close the connection +ola_client.Stop(); +return 0; +} +