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.
Dependents: 7_21_17_FSG 7_26_17_FSG
Fork of System_ by
conversions.cpp
- Committer:
- mdavis30
- Date:
- 2017-07-28
- Revision:
- 7:60b1f9e72822
- Parent:
- 6:8764d841a892
File content as of revision 7:60b1f9e72822:
#include "conversions.hpp"
float counts_to_dist(int count)
{
    float conv = 0.001220703*(-105.98*count)+388.51; //MELISSA +5mm off from end
    //float conv = 0.001220703*(-108.84*count)+399.27;
    //float conv = .13109129517*count-6; // TRENT
    
    //TROY
    //float conv = -0.1243 * count + 378.31;  //created on 7/13/2017 by reading from extended (0 mm) end of piston
    return conv;
};
//had an issue with the original equation
//need to double check the counts VS position (with a tape measurer)
//adc.ch0 or whatever gives you this
            
    