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
ForceRead.cpp
- Committer:
- Bhoney
- Date:
- 2019-08-22
- Revision:
- 19:67584cb64b9c
- Parent:
- 18:25281ee3a517
File content as of revision 19:67584cb64b9c:
#include "mbed.h" AnalogIn force_R1(PC_2); AnalogIn force_R2(PC_3); AnalogIn force_R3(PC_4); AnalogIn force_R4(PC_5); extern Serial bt; //extern Serial pc; float sum_L[4]={0,}; float sum_R[4]={0,}; float avg_L[4]={0,}; float avg_R[4]={0,}; void ReadForce() { int force_R[4]; force_R[0] = force_R1.read()*99; force_R[1] = force_R2.read()*99; force_R[2] = force_R3.read()*99; force_R[3] = force_R4.read()*99; bt.printf("<FOT%2d%2d%2d%2d>\n", force_R[0], force_R[1], force_R[2], force_R[3]); }