-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
52 lines (34 loc) · 889 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "OdroidDMXdriver.h"
#include <stdio.h>
int main(){
printf("Start\n");
struct odroidDMX * dmx1;
struct odroidDMX * dmx2;
dmx1 = initDMX("/dev/ttyS0", 3);
dmx2 = initDMX("/dev/ttyS1", 16);
setMaxDMXchannel(dmx1, 10);
setMaxDMXchannel(dmx2, 10);
startOdroidDMXserver(dmx1);
startOdroidDMXserver(dmx2);
for(int i = 0; i <=255; i++){
setDMXchannel(dmx1, 1, i);
setDMXchannel(dmx2, 3, i);
usleep(10000);
}
for(int i = 0; i <=255; i++){
setDMXchannel(dmx1, 2, i);
setDMXchannel(dmx2, 1, i);
usleep(10000);
}
for(int i = 255; i >= 0; i--){
setDMXchannel(dmx1, 1, i);
setDMXchannel(dmx2, 3, i);
usleep(10000);
}
sleep(2);
stopOdroidDMXserver(dmx1);
stopOdroidDMXserver(dmx2);
printf("End\n");
sleep(2);
return 0;
}