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.
sqrwave.h
00001 /** sqrwave class 00002 * Copyright (c) 2014, 2015 Motoo Tanaka @ Design Methodology Lab 00003 * 00004 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00005 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00006 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00007 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00008 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00009 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00010 * THE SOFTWARE. 00011 */ 00012 #ifndef _SQR_WAVE_H_ 00013 #define _SQR_WAVE_H_ included 00014 #include "wave.h" 00015 00016 /** sqrwave square wave class 00017 */ 00018 class sqrwave : public wave { 00019 public: 00020 /** constructor 00021 * 00022 * @param float v amplitude in voltage (0.0 ~ 3.28V for FRDM-KL25Z) 00023 * @param int f frequency in Hz (1 ~ 10000Hz) 00024 * @param int d duty in percent (0 ~ 100%) 0% for DC 0V, 100% for DC Vref volt 00025 * @param int p phase in degree (0 ~ 359 degree) 00026 * @returns sqrwave class instance 00027 */ 00028 sqrwave(float v, int f, int d = 50, int p = 0); 00029 00030 /** destructor */ 00031 ~sqrwave(void) ; 00032 00033 /** inspector for the value at _pos 00034 * 00035 * @returns int value at current position 00036 */ 00037 virtual int value(void) ; // returns current value 00038 00039 protected: 00040 00041 private: 00042 } ; 00043 00044 #endif /* _SQR_WAVE_H_ */
Generated on Wed Jul 13 2022 01:58:56 by
1.7.2