Guojun Jiang
/
StewartPlatform
stewartplatform
Fork of PwmOut_HelloWorld by
main.cpp@2:50062ac8646d, 2016-05-07 (annotated)
- Committer:
- wheels
- Date:
- Sat May 07 12:27:09 2016 +0000
- Revision:
- 2:50062ac8646d
- Parent:
- 1:5160ea45399b
- Child:
- 3:c5ea5b6a7460
stewart platform
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:50d2b9c62765 | 1 | #include "mbed.h" |
wheels | 2:50062ac8646d | 2 | //#include "motor.h" |
wheels | 2:50062ac8646d | 3 | #include "usart.h" |
wheels | 2:50062ac8646d | 4 | //#include "file.h" |
wheels | 2:50062ac8646d | 5 | |
mbedAustin | 1:5160ea45399b | 6 | |
wheels | 2:50062ac8646d | 7 | //extern PwmOut motor[6]; |
wheels | 2:50062ac8646d | 8 | extern Serial usart; |
wheels | 2:50062ac8646d | 9 | |
wheels | 2:50062ac8646d | 10 | extern char position[6]; |
wheels | 2:50062ac8646d | 11 | extern bool instructionReceived; |
mbedAustin | 1:5160ea45399b | 12 | |
mbed_official | 0:50d2b9c62765 | 13 | int main() { |
wheels | 2:50062ac8646d | 14 | int baud = 9600; //baud rate |
wheels | 2:50062ac8646d | 15 | usart_init(baud); //serial port initialize |
wheels | 2:50062ac8646d | 16 | // motor_init(); |
wheels | 2:50062ac8646d | 17 | usart.printf("new test!"); |
wheels | 2:50062ac8646d | 18 | |
wheels | 2:50062ac8646d | 19 | while(1) { |
wheels | 2:50062ac8646d | 20 | if (instructionReceived) { |
wheels | 2:50062ac8646d | 21 | instructionReceived = false; |
wheels | 2:50062ac8646d | 22 | usart.printf("0 \n" ); |
wheels | 2:50062ac8646d | 23 | //usart.printf("pos(%d,%d,%d,%d,%d,%d) \n", position[0], position[1], position[2], position[3], position[4], position[5]); |
wheels | 2:50062ac8646d | 24 | // motor_drive(); |
wheels | 2:50062ac8646d | 25 | } |
wheels | 2:50062ac8646d | 26 | } |
wheels | 2:50062ac8646d | 27 | } |