added entec driver and OLA test programs
parent
757ed7604a
commit
1654d20ead
|
@ -0,0 +1 @@
|
|||
Subproject commit 3253e7b6ef906ce78e423245925f658cba35530a
|
Binary file not shown.
|
@ -0,0 +1,47 @@
|
|||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <ola/DmxBuffer.h>
|
||||
#include <ola/Logging.h>
|
||||
#include <ola/StreamingClient.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
g++ -I/usr/local/include/libola -L/usr/local/lib -lola -lolacommon -lprotobuf blackout.cpp -o blackout
|
|
@ -0,0 +1 @@
|
|||
g++ -I/usr/local/include/libola -L/usr/local/lib -lola -lolacommon -lprotobuf flash.cpp -o flash
|
Binary file not shown.
|
@ -0,0 +1,57 @@
|
|||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <ola/DmxBuffer.h>
|
||||
#include <ola/Logging.h>
|
||||
#include <ola/StreamingClient.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue