https://github.com/RobTillaart/FunctionGenerator
Configurationvoid setPeriod(float period = 1.0) set the period of the wave in seconds.float getPeriod() returns the set period.void setFrequency(float frequency = 1.0) set the frequency of the wave in Hertz (1/s).float getFrequency() returns the set frequency in Hertz.void setAmplitude(float amplitude = 1.0) sets the amplitude of the wave. The range is from -amplitude to +amplitude. Setting the amplitude to 0 gives effectively a zero signal. Setting the amplitude to a negative value effectively inverts the signal.float getAmplitude() returns the set amplitude.void setPhase(float phase = 0.0) shifts the phase of the wave. Will only be noticeable when compared with other waves. Phase is also known as the X- or horizontal shift.float getPhase() returns the set phase.void setYShift(float yShift = 0.0) sets an Y-shift or vertical offset in amplitude. This allows to set e.g. the zero level.float getYShift() returns the set Y-shift.void setDutyCycle(float percentage = 100) sets the duty cycle of the signal. Experimental, not all waveforms have a duty cycle or interpret it differently, see below. Duty cycle must be between 0 and 100% and will be clipped otherwise.float getDutyCycle() returns the set duty cycle.void setRandomSeed(uint32_t a, uint32_t b = 314159265) sets the initial seeds for the (Marsaglia) random number generator. The first is mandatory, the second is optional.
No Comments have been Posted.