Takeuchi Kouichi
/
20130530_Tamagawa_IMU_3Servo
多摩川精機製IMUを接続し、3サーボを制御するモーショントラッキングシステム用プログラムです。
main.cpp@0:0522a96f04ed, 2011-01-30 (annotated)
- Committer:
- takeuchi
- Date:
- Sun Jan 30 06:55:22 2011 +0000
- Revision:
- 0:0522a96f04ed
- Child:
- 1:a4ab99c0f7ea
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takeuchi | 0:0522a96f04ed | 1 | // GPS GT-720F Test01 |
takeuchi | 0:0522a96f04ed | 2 | #include "mbed.h" |
takeuchi | 0:0522a96f04ed | 3 | #include "TextLCD0420.h" |
takeuchi | 0:0522a96f04ed | 4 | |
takeuchi | 0:0522a96f04ed | 5 | #define ON 1 |
takeuchi | 0:0522a96f04ed | 6 | #define OFF 0 |
takeuchi | 0:0522a96f04ed | 7 | |
takeuchi | 0:0522a96f04ed | 8 | DigitalOut mled0(LED1); |
takeuchi | 0:0522a96f04ed | 9 | DigitalOut mled1(LED2); |
takeuchi | 0:0522a96f04ed | 10 | |
takeuchi | 0:0522a96f04ed | 11 | TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,20,4); // rs, rw, e, d0, d1, d2, d3 |
takeuchi | 0:0522a96f04ed | 12 | Serial pc(USBTX, USBRX); // tx, rx |
takeuchi | 0:0522a96f04ed | 13 | Serial gps(p9,p10); |
takeuchi | 0:0522a96f04ed | 14 | |
takeuchi | 0:0522a96f04ed | 15 | int main() { |
takeuchi | 0:0522a96f04ed | 16 | |
takeuchi | 0:0522a96f04ed | 17 | unsigned char c; |
takeuchi | 0:0522a96f04ed | 18 | int i; |
takeuchi | 0:0522a96f04ed | 19 | |
takeuchi | 0:0522a96f04ed | 20 | gps.baud(9600); |
takeuchi | 0:0522a96f04ed | 21 | lcd.cls(); |
takeuchi | 0:0522a96f04ed | 22 | lcd.locate(0,0); |
takeuchi | 0:0522a96f04ed | 23 | lcd.printf("GPS GT720F Test\n"); |
takeuchi | 0:0522a96f04ed | 24 | |
takeuchi | 0:0522a96f04ed | 25 | while (1) { |
takeuchi | 0:0522a96f04ed | 26 | while(gps.getc()!='$'){ |
takeuchi | 0:0522a96f04ed | 27 | } |
takeuchi | 0:0522a96f04ed | 28 | pc.printf("\x0D");// new line |
takeuchi | 0:0522a96f04ed | 29 | pc.printf("Recive start:\n"); |
takeuchi | 0:0522a96f04ed | 30 | c=gps.getc(); |
takeuchi | 0:0522a96f04ed | 31 | while( c != '\r'){ //line end |
takeuchi | 0:0522a96f04ed | 32 | pc.putc(c); |
takeuchi | 0:0522a96f04ed | 33 | c=gps.getc(); |
takeuchi | 0:0522a96f04ed | 34 | } |
takeuchi | 0:0522a96f04ed | 35 | pc.printf("\n"); |
takeuchi | 0:0522a96f04ed | 36 | |
takeuchi | 0:0522a96f04ed | 37 | }//while |
takeuchi | 0:0522a96f04ed | 38 | }//main |
takeuchi | 0:0522a96f04ed | 39 | |
takeuchi | 0:0522a96f04ed | 40 | |
takeuchi | 0:0522a96f04ed | 41 |