Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: ForceRead.cpp
- Revision:
- 6:549177f76f8e
- Parent:
- 4:bf4ad2079096
- Child:
- 8:a435e7aa7a02
diff -r bf4ad2079096 -r 549177f76f8e ForceRead.cpp --- a/ForceRead.cpp Fri Dec 21 20:39:24 2018 +0000 +++ b/ForceRead.cpp Wed Dec 26 10:54:31 2018 +0000 @@ -68,7 +68,21 @@ avg_R[2] = sum_R[2]/6; avg_R[3] = sum_R[3]/6; - bt.printf("%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f\n", avg_L[0],avg_L[1],avg_L[2],avg_L[3],avg_R[0],avg_R[1],avg_R[2],avg_R[3]); +// bt.printf("%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f\n", avg_L[0],avg_L[1],avg_L[2],avg_L[3],avg_R[0],avg_R[1],avg_R[2],avg_R[3]); + bt.putc('<'); + bt.putc('F'); + bt.putc('O'); + bt.putc('T'); + bt.putc((unsigned char)((int)avg_L[0]*127)); + bt.putc((unsigned char)((int)avg_L[1]*127)); + bt.putc((unsigned char)((int)avg_L[2]*127)); + bt.putc((unsigned char)((int)avg_L[3]*127)); + bt.putc((unsigned char)((int)avg_R[0]*127)); + bt.putc((unsigned char)((int)avg_R[1]*127)); + bt.putc((unsigned char)((int)avg_R[2]*127)); + bt.putc((unsigned char)((int)avg_R[3]*127)); + bt.putc('>'); + readCount=0; @@ -100,7 +114,22 @@ force_R[2] = force_R3.read(); force_R[3] = force_R4.read(); - bt.printf("%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f\n", force_L[0],force_L[1],force_L[2],force_L[3],force_R[0],force_R[1],force_R[2],force_R[3]); + //bt.printf("%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f,%1.3f\n", force_L[0],force_L[1],force_L[2],force_L[3],force_R[0],force_R[1],force_R[2],force_R[3]); + bt.putc('<'); + bt.putc('F'); + bt.putc('O'); + bt.putc('T'); + bt.putc((unsigned char)((int)force_L[0]*127)); + bt.putc((unsigned char)((int)force_L[1]*127)); + bt.putc((unsigned char)((int)force_L[2]*127)); + bt.putc((unsigned char)((int)force_L[3]*127)); + bt.putc((unsigned char)((int)force_R[0]*127)); + bt.putc((unsigned char)((int)force_R[1]*127)); + bt.putc((unsigned char)((int)force_R[2]*127)); + bt.putc((unsigned char)((int)force_R[3]*127)); + bt.putc('>'); + +