-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOnkyoRI.h
41 lines (34 loc) · 1.04 KB
/
OnkyoRI.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
//---------------------------------------------------------------------------
//
// Name: OnkyoRI.h
// Author: Vita Tucek
// Created: 19.1.2016
// License: MIT
// Description: Library for control Onkyo devices with RI port.
// Message is composed from header, 12 databits and footer.
//
// For timing delay() function is used. That means until send
// is completed program is blocked (max send() duration is 61ms).
//
//---------------------------------------------------------------------------
#ifndef ONKYORI_H
#define ONKYORI_H
class OnkyoRI
{
public:
OnkyoRI() {};
OnkyoRI(int pin) { _outputPin = pin; pinMode(_outputPin, OUTPUT); digitalWrite(_outputPin, LOW); };
~OnkyoRI() { };
//send command message to device
void send(int command);
private:
//
int _outputPin;
//write message header
void writeHeader();
//write message bit
void writeBit(bool level);
//write message footer
void writeFooter();
};
#endif