-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathADDAC_DMX.h
executable file
·87 lines (65 loc) · 1.85 KB
/
ADDAC_DMX.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//CODE BASED ON:
/*!
* @original file DmxSimple.h
* Project DmxSimple
* @brief A simple interface to DMX.
* Version 3
* @author Peter Knight
* @date 2008-2009
@modified 12.2012
@author ag
modified:
.integrated DmxSimple Library
-> corrected Library to support ATMEGA2560
-> Line 34 of DmxSimple.cpp needs to be corrected, add this in ifDefined statement:
defined(__AVR_ATmega2560__) ||
should look something like this in the end:
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega1280__)
-> Error found in this discussion:
http://code.google.com/p/tinkerit/wiki/DmxSimple
*/
#ifndef ADDAC_DMX_h
#define ADDAC_DMX_h
#include <StandardCplusplus.h>
#include <vector>
using namespace std;
#include <inttypes.h>
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include <WProgram.h>
// Provides ISR
#include <avr/interrupt.h>
#endif
#if RAMEND <= 0x4FF
#define DMX_SIZE 128
#else
#define DMX_SIZE 512
#endif
#define DMXA 48
#define DMXB 45
#include "ADDAC_dmxChannel.h"
#include "ADDAC_Timer.h"
class ADDAC_DMX
{
public:
void maxChannel(int);
void write(int, uint8_t);
void usePin(uint8_t);
//ADDAC FUNCTIONS
float CVstream;
float actualValue;
void setup();
void setup(int _pin);
void addChannel(int channel);
void update();
void fadeIn(int _channel, int _maxValue, long _time);
void fadeOut(int _channel, int _minValue, long _time);
void strobe(int _channel, long _time);
void set(int _channel, int _value);
int DMXstream(int _channel);
ADDAC_Timer delayControl;
vector<ADDAC_dmxChannel> channel;
};
extern ADDAC_DMX DmxSimple;
#endif