FSLP Window USB Serial Output
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 Serial pc(USBTX, USBRX); 00003 00004 DigitalInOut pinReference(p13); 00005 DigitalOut driveLine2(p14); 00006 AnalogIn senseLine3(p15); 00007 00008 00009 int main() { 00010 while(1) { 00011 pinReference.output(); 00012 pinReference = 0; 00013 driveLine2 = 1; 00014 float force = 0; 00015 force = senseLine3.read(); 00016 wait(0.001); 00017 pinReference.input(); 00018 driveLine2 = 0; 00019 float position = 0; 00020 position = senseLine3.read(); 00021 pc.printf("Force: %f", force); 00022 pc.printf(" Position: %f\r\n", position); 00023 wait(1); 00024 00025 } 00026 } 00027 00028
Generated on Sat Jul 16 2022 14:25:29 by
1.7.2
Force Sensing Linear Potentiometer