EasyVR3_LED_Library
EasyVR.h@4:ebfb0b26d192, 2015-10-22 (annotated)
- Committer:
- Xiaofei
- Date:
- Thu Oct 22 21:04:10 2015 +0000
- Revision:
- 4:ebfb0b26d192
- Parent:
- 3:05cef12c147a
- Child:
- 5:2e0f2c318e15
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Xiaofei | 0:8ec860bd579a | 1 | #pragma once |
Xiaofei | 0:8ec860bd579a | 2 | #include "mbed.h" |
Xiaofei | 0:8ec860bd579a | 3 | #include "protocol.h" |
Xiaofei | 3:05cef12c147a | 4 | |
Xiaofei | 4:ebfb0b26d192 | 5 | /** My HelloWorld csdfsdfsdfsdfsdlass. |
Xiaofei | 3:05cef12c147a | 6 | * Used for printing "Hello World" on USB serial. |
Xiaofei | 3:05cef12c147a | 7 | * |
Xiaofei | 3:05cef12c147a | 8 | * Example: |
Xiaofei | 3:05cef12c147a | 9 | * @code |
Xiaofei | 3:05cef12c147a | 10 | * #include "mbed.h" |
Xiaofei | 3:05cef12c147a | 11 | * #include "HelloWorld.h" |
Xiaofei | 3:05cef12c147a | 12 | * |
Xiaofei | 3:05cef12c147a | 13 | * HelloWorld hw(); |
Xiaofei | 3:05cef12c147a | 14 | * |
Xiaofei | 3:05cef12c147a | 15 | * int main() { |
Xiaofei | 3:05cef12c147a | 16 | * hw.printIt(2); |
Xiaofei | 3:05cef12c147a | 17 | * } |
Xiaofei | 3:05cef12c147a | 18 | * @endcode |
Xiaofei | 3:05cef12c147a | 19 | */ |
Xiaofei | 0:8ec860bd579a | 20 | class EasyVR |
Xiaofei | 0:8ec860bd579a | 21 | { |
Xiaofei | 0:8ec860bd579a | 22 | public: |
Xiaofei | 1:8b8bb6ac9d11 | 23 | /** EasyVR use Serial communication*/ |
Xiaofei | 1:8b8bb6ac9d11 | 24 | EasyVR(PinName tx,PinName rx); |
Xiaofei | 1:8b8bb6ac9d11 | 25 | ~EasyVR(); |
Xiaofei | 1:8b8bb6ac9d11 | 26 | |
Xiaofei | 1:8b8bb6ac9d11 | 27 | /** Send a command to EasyVR to excute EasyVR build in routine*/ |
Xiaofei | 1:8b8bb6ac9d11 | 28 | void sendCmd(uint8_t); |
Xiaofei | 0:8ec860bd579a | 29 | |
Xiaofei | 1:8b8bb6ac9d11 | 30 | /** Send a argument for the routine */ |
Xiaofei | 1:8b8bb6ac9d11 | 31 | void sendArg(int8_t); |
Xiaofei | 0:8ec860bd579a | 32 | |
Xiaofei | 1:8b8bb6ac9d11 | 33 | /** Receive return value from EasyVR routine */ |
Xiaofei | 1:8b8bb6ac9d11 | 34 | int8_t recv(int8_t timeOut = 1); |
Xiaofei | 1:8b8bb6ac9d11 | 35 | |
Xiaofei | 1:8b8bb6ac9d11 | 36 | /** Decrypt returned value from EasyVR */ |
Xiaofei | 1:8b8bb6ac9d11 | 37 | void decrypt(char*); |
Xiaofei | 0:8ec860bd579a | 38 | |
Xiaofei | 1:8b8bb6ac9d11 | 39 | /** Used for awake EasyVR, default time out value to 100*/ |
Xiaofei | 1:8b8bb6ac9d11 | 40 | bool awake(int timeOut = 100); |
Xiaofei | 0:8ec860bd579a | 41 | |
Xiaofei | 0:8ec860bd579a | 42 | |
Xiaofei | 0:8ec860bd579a | 43 | private: |
Xiaofei | 0:8ec860bd579a | 44 | Serial _easyVR; |
Xiaofei | 0:8ec860bd579a | 45 | }; |