FSR

Dependencies:   FSR mbed

main.cpp

Committer:
cshao06
Date:
2015-10-22
Revision:
0:5521da8243b8

File content as of revision 0:5521da8243b8:

#include "mbed.h"
#include "FSR.h"

FSR fsr(p20, 10); // Pin 20 is used as the AnalogIn pin and a 10k resistor is used as a voltage divider

int main(){
    while (1)
    {
        printf("The raw data is %f\n", fsr.readRaw());
        printf("The resistance of the FSR is %f\n", fsr.readFSRResistance());
        printf("The weight on the FSR is %f\n\n", fsr.readWeight());
        wait(0.3); //just here to slow down the output for easier reading
    }
}