test code Just sending gps output
Dependencies: mbed
main.cpp@1:fb3a6e1626c7, 2015-04-20 (annotated)
- Committer:
- wasaco
- Date:
- Mon Apr 20 06:07:42 2015 +0000
- Revision:
- 1:fb3a6e1626c7
- Parent:
- 0:47f843629085
test; just sending outputs of gps
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wasaco | 0:47f843629085 | 1 | #include "mbed.h" |
wasaco | 0:47f843629085 | 2 | |
wasaco | 0:47f843629085 | 3 | Serial pc(USBTX, USBRX); // tx, rx |
wasaco | 1:fb3a6e1626c7 | 4 | Serial gps(PA_2, PA_3);// tx, rx |
wasaco | 0:47f843629085 | 5 | |
wasaco | 0:47f843629085 | 6 | int main() |
wasaco | 0:47f843629085 | 7 | { |
wasaco | 0:47f843629085 | 8 | char c; |
wasaco | 0:47f843629085 | 9 | gps.baud(4800); |
wasaco | 0:47f843629085 | 10 | |
wasaco | 0:47f843629085 | 11 | pc.printf("gps start! \r\n"); |
wasaco | 0:47f843629085 | 12 | |
wasaco | 0:47f843629085 | 13 | while(1) { |
wasaco | 0:47f843629085 | 14 | // if(gps.readable()){ |
wasaco | 0:47f843629085 | 15 | c = gps.getc(); |
wasaco | 0:47f843629085 | 16 | pc.printf("ok \r\n"); |
wasaco | 0:47f843629085 | 17 | pc.putc(c); |
wasaco | 0:47f843629085 | 18 | // } else { |
wasaco | 0:47f843629085 | 19 | // } |
wasaco | 0:47f843629085 | 20 | } |
wasaco | 0:47f843629085 | 21 | } |
wasaco | 0:47f843629085 | 22 | |
wasaco | 0:47f843629085 | 23 |