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.
Dependencies: mbed vcdLogger vcdSignal
slider.cpp
00001 /*! 00002 @file slider.cpp 00003 00004 The implementation of the slider sensor signal class. 00005 00006 @par Full Description 00007 The implementation of the slider sensor signal class. 00008 00009 @if REVISION_HISTORY_INCLUDED 00010 @par Edit History 00011 @li [0] wojciech.rynczuk@wp.pl 20-JAN-2015 Initial file revision. 00012 @endif 00013 00014 @ingroup Signal 00015 00016 The MIT License (MIT) 00017 Copyright (c) 2016 Wojciech Rynczuk 00018 00019 */ 00020 00021 #include "slider.hpp " 00022 00023 Slider::Slider(const string& name, Logger& logger) : Signal(name, 7, logger) 00024 { 00025 m_SliderPrev = 0; 00026 m_SliderCurr = 0; 00027 } 00028 00029 void Slider::PrintState() 00030 { 00031 string suffix(""); 00032 string msg(""); 00033 int32_t time_ref = 0; 00034 00035 m_SliderCurr = m_Slider.readPercentage() * 100; 00036 if ( (CheckFilter()) || \ 00037 (fabs((float)(m_SliderCurr - m_SliderPrev)) > 0)) 00038 { 00039 PrintVector(m_SliderCurr, suffix, msg, time_ref); 00040 m_SliderPrev = m_SliderCurr; 00041 } 00042 }
Generated on Tue Jul 12 2022 21:39:12 by
1.7.2