Serial Bridge program to support using the EasyVR with mbed. It is run when using the PC-based EasyVR GUI tools for voice recognition training and testing.
main.cpp@0:41997ef0ebb8, 2011-05-08 (annotated)
- Committer:
- 4180_1
- Date:
- Sun May 08 00:00:02 2011 +0000
- Revision:
- 0:41997ef0ebb8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
4180_1 | 0:41997ef0ebb8 | 1 | //EasyVR Bridge Program to connect to PC using mbed |
4180_1 | 0:41997ef0ebb8 | 2 | #include "mbed.h" |
4180_1 | 0:41997ef0ebb8 | 3 | |
4180_1 | 0:41997ef0ebb8 | 4 | Serial pc(USBTX, USBRX); // tx, rx |
4180_1 | 0:41997ef0ebb8 | 5 | Serial device(p13, p14); // tx, rx |
4180_1 | 0:41997ef0ebb8 | 6 | |
4180_1 | 0:41997ef0ebb8 | 7 | int main() { |
4180_1 | 0:41997ef0ebb8 | 8 | while(1) { |
4180_1 | 0:41997ef0ebb8 | 9 | if(pc.readable()) { |
4180_1 | 0:41997ef0ebb8 | 10 | device.putc(pc.getc()); |
4180_1 | 0:41997ef0ebb8 | 11 | } |
4180_1 | 0:41997ef0ebb8 | 12 | if(device.readable()) { |
4180_1 | 0:41997ef0ebb8 | 13 | pc.putc(device.getc()); |
4180_1 | 0:41997ef0ebb8 | 14 | } |
4180_1 | 0:41997ef0ebb8 | 15 | } |
4180_1 | 0:41997ef0ebb8 | 16 | } |
4180_1 | 0:41997ef0ebb8 | 17 | |
4180_1 | 0:41997ef0ebb8 | 18 | |
4180_1 | 0:41997ef0ebb8 | 19 |