-
Notifications
You must be signed in to change notification settings - Fork 1
/
MP3Trigger.cpp
38 lines (33 loc) · 919 Bytes
/
MP3Trigger.cpp
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
#include "MP3Trigger.h"
#include "EZB.h"
MP3Trigger::MP3Trigger(EZB* ezb){
m_ezb = ezb;
BaudRate = UartClass::Baud_38400;
}
void MP3Trigger::Forward(){
unsigned char byte[1];
byte[0] = 70;
m_ezb->Uart->SendSerial(CommunicationPort, BaudRate, byte, 1);
}
void MP3Trigger::PlayTrack(unsigned char trackNumber){
unsigned char bytes[2];
bytes[0] = 112;
bytes[1] = trackNumber;
m_ezb->Uart->SendSerial(CommunicationPort, BaudRate, bytes, 2);
}
void MP3Trigger::Reverse(){
unsigned char byte[1];
byte[0] = 82;
m_ezb->Uart->SendSerial(CommunicationPort, BaudRate, byte, 1);
}
void MP3Trigger::SetVolume(unsigned char volume){
unsigned char bytes[2];
bytes[0] = 118;
bytes[1] = volume;
m_ezb->Uart->SendSerial(CommunicationPort, BaudRate, bytes, 2);
}
void MP3Trigger::StartStop(){
unsigned char byte[1];
byte[0] = 79;
m_ezb->Uart->SendSerial(CommunicationPort, BaudRate, byte, 1);
}