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.
main.cpp
00001 #include "mbed.h" 00002 #include "FSR.h" 00003 00004 FSR fsr(p20, 10); // Pin 20 is used as the AnalogIn pin and a 10k resistor is used as a voltage divider 00005 00006 int main(){ 00007 while (1) 00008 { 00009 printf("The raw data is %f\n", fsr.readRaw()); 00010 printf("The resistance of the FSR is %f\n", fsr.readFSRResistance()); 00011 printf("The weight on the FSR is %f\n\n", fsr.readWeight()); 00012 wait(0.3); //just here to slow down the output for easier reading 00013 } 00014 }
Generated on Wed Jul 13 2022 01:00:46 by
1.7.2
Force Sensitive Resistors (FSR)