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.
Fork of tsi_sensor by
Revision 5:37ae0d169e13, committed 2014-11-11
- Comitter:
- neilh20
- Date:
- Tue Nov 11 22:18:10 2014 +0000
- Parent:
- 4:f64097679f27
- Commit message:
- Kl25z water depth to USB,
Changed in this revision
tsi_sensor.cpp | Show annotated file Show diff for this revision Revisions of this file |
tsi_sensor.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r f64097679f27 -r 37ae0d169e13 tsi_sensor.cpp --- a/tsi_sensor.cpp Mon Aug 04 07:43:15 2014 +0000 +++ b/tsi_sensor.cpp Tue Nov 11 22:18:10 2014 +0000 @@ -96,8 +96,11 @@ void TSIAnalogSlider::sliderRead(void ) { if (_scan_in_progress) { _scan_in_progress = 0; - uint32_t delta0 = _elec0.getDelta(); - uint32_t delta1 = _elec1.getDelta(); + //uint32_t delta0 = _elec0.getDelta(); + //uint32_t delta1 = _elec1.getDelta(); + delta0 = _elec0.getDelta(); + delta1 = _elec1.getDelta(); + //pc.printf(" ~%i~%i~",delta0,delta1); if ((delta0 > _elec0.getThreshold()) || (delta1 > _elec1.getThreshold())) { uint32_t perc_pos0 = (delta0 * 100) / (delta0 + delta1);
diff -r f64097679f27 -r 37ae0d169e13 tsi_sensor.h --- a/tsi_sensor.h Mon Aug 04 07:43:15 2014 +0000 +++ b/tsi_sensor.h Tue Nov 11 22:18:10 2014 +0000 @@ -209,6 +209,13 @@ static TSIAnalogSlider *getInstance() { return _instance; } + + uint32_t getDelta0() { + return delta0; + } + uint32_t getDelta1() { + return delta1; + } private: void initObject(void); //shared constructor code void sliderRead(void); @@ -235,6 +242,9 @@ uint32_t _absolute_percentage_pos; uint32_t _absolute_distance_pos; uint8_t _range; + + uint32_t delta0; //= _elec0.getDelta(); + uint32_t delta1; // = _elec1.getDelta(); protected: static TSIAnalogSlider *_instance; };