Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
EasyVR Class Reference
EasyVR class for ECE 4180 lab 4. More...
#include <easyvr.h>
Public Member Functions | |
| EasyVR (PinName tx, PinName rx) | |
| EasyVR constructor. | |
| void | wakeup () |
| Wakes up the EasyVR by sending it a "break" signal until a reply of "success" has been received. | |
| void | setup (int lang, int timeout) |
| Sets up the EasyVR. | |
| void | send (char byte) |
| Sends a single byte to the EasyVR. | |
| char | receive () |
| Receives a single byte from the EasyVR. | |
| void | baud (int rate) |
| Sets the EasyVR's baud rate. | |
Detailed Description
EasyVR class for ECE 4180 lab 4.
Used for interfacing with an EasyVR module.
Example:
#include "mbed.h" #include "easyvr.h" EasyVR easyVR( p27, p28 ); int main() { easyVR.wakeup(); easyVR.setup(); }
Definition at line 87 of file easyvr.h.
Constructor & Destructor Documentation
| EasyVR | ( | PinName | tx, |
| PinName | rx | ||
| ) |
EasyVR constructor.
Initializes the serial interface for the EasyVR module.
- Parameters:
-
tx The TX pin on the mbed that should be used. This connects to the EasyVR's RX pin. rx The RX pin on the mbed that should be used. This connects to the EasyVR's TX pin.
Definition at line 3 of file easyvr.cpp.
Member Function Documentation
| void baud | ( | int | rate ) |
Sets the EasyVR's baud rate.
For speech recognition, this must be exactly 9600.
- Parameters:
-
rate The baud rate the EasyVR should communicate with.
- See also:
- Serial.baud()
Definition at line 64 of file easyvr.cpp.
| char receive | ( | ) |
Receives a single byte from the EasyVR.
This is most commonly used to receive signals from the EasyVR. Note that this is just a wrapper for the EasyVR's serial interface's getc() function.
Be aware that this is a blocking method - it will stall the program until a byte is received!
- Returns:
- A single byte from the EasyVR.
- See also:
- Serial.putc()
Definition at line 59 of file easyvr.cpp.
| void send | ( | char | byte ) |
Sends a single byte to the EasyVR.
This is most commonly used to send commands and parameters for those commands. Note that this is just a wrapper for the EasyVR's serial interface's putc() function.
- Parameters:
-
byte The byte to be sent.
- See also:
- Serial.putc()
Definition at line 54 of file easyvr.cpp.
| void setup | ( | int | lang, |
| int | timeout | ||
| ) |
Sets up the EasyVR.
This includes ensuring the EasyVR module is a valid EasyVR device, setting its timeout value, and its language.
- Parameters:
-
lang The language to be used, as an encoded integer. i.e. 0 is 'A', 1 is 'B', and so forth. timeout The timeout to be used, in seconds, as an encoded integer.
Definition at line 17 of file easyvr.cpp.
| void wakeup | ( | ) |
Wakes up the EasyVR by sending it a "break" signal until a reply of "success" has been received.
Definition at line 8 of file easyvr.cpp.
Generated on Fri Jul 15 2022 06:55:58 by
1.7.2