T Nara
/
robottt
ok
Revision 6:1c68c8eb8082, committed 2017-01-27
- Comitter:
- tknara
- Date:
- Fri Jan 27 09:40:26 2017 +0000
- Parent:
- 5:714f1a772584
- Commit message:
- get stick angle sample ;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 714f1a772584 -r 1c68c8eb8082 main.cpp --- a/main.cpp Tue Mar 22 02:21:14 2016 +0000 +++ b/main.cpp Fri Jan 27 09:40:26 2017 +0000 @@ -21,10 +21,12 @@ BusOut led(LED1,LED2,LED3,LED4); AnalogIn sticky(p15); AnalogIn stickx(p16); -AnalogIn speed(p17); +AnalogIn stickx2(p17); +AnalogIn sticky2(p18); AnalogIn RT(p19); AnalogIn LT(p20); Serial pc(USBTX,USBRX); +uint8_t GetAngle() uint8_t getdeg(float *p){ int counter = 0; float x=0,y=0,theta=0,deg=0; @@ -83,7 +85,7 @@ int main() { uint8_t deg,dire2,right,left; float dire1; - Xbee.baud(9600); + Xbee.baud(19200); while(1) { right = RT*255; left = LT*255; @@ -93,6 +95,10 @@ Xbee.putc(deg); Xbee.putc(right); Xbee.putc(left); + /* + Xbee.putc('\r'); + Xbee.putc('\n'); + */ printf("%d,%d,%d,%d\n",deg,dire2,right,left); wait(0.1); }