MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeVoice.h
Go to the documentation of this file.
1
43#ifndef MeVoice_H
44#define MeVoice_H
45
46#include <stdint.h>
47#include <stdbool.h>
48#include <Arduino.h>
49#include "MeConfig.h"
50#include "MeSerial.h"
51
52/* NEC Code table */
53#define CMD_FORWARD (11)
54#define CMD_BACK (13)
55#define CMD_LEFT (7)
56#define CMD_RIGHT (9)
57#define CMD_DIS_ON (3)
58#define CMD_DIS_OFF (5)
59
60#ifdef ME_PORT_DEFINED
61#include "MePort.h"
62#endif /* ME_PORT_DEFINED */
63
69#ifndef ME_PORT_DEFINED
70 class MeVoice
71#else // !ME_PORT_DEFINED
72class MeVoice : public MeSerial
73#endif // !ME_PORT_DEFINED
74{
75 public:
76#ifdef ME_PORT_DEFINED
83 MeVoice(void);
84
91 MeVoice(uint8_t port);
92#else // ME_PORT_DEFINED
103 MeVoice(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic);
104#endif // ME_PORT_DEFINED
105
119 void begin(long = 9600);
120
135 int16_t read(void);
136
149 uint8_t getCode(void);
150
163 void loop(void);
164 private:
165 static volatile uint8_t _RxPin;
166 static volatile uint8_t _TxPin;
167 static volatile unsigned long last_time;
168 uint8_t _irCode;
169};
170
171#endif
172
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MeSerial.h
Header for for MeSerial.cpp module.
MeSerial
Driver for serial.
Definition MeSerial.h:67
MeVoice
Driver for Me voice device.
Definition MeVoice.h:74
MeVoice::getCode
uint8_t getCode(void)
Definition MeVoice.cpp:148
MeVoice::begin
void begin(long=9600)
Definition MeVoice.cpp:102
MeVoice::read
int16_t read(void)
Definition MeVoice.cpp:128
MeVoice::loop
void loop(void)
Definition MeVoice.cpp:165
MeVoice::MeVoice
MeVoice(void)
Definition MeVoice.cpp:55