mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
0.2.6 FunctionGenerator
This commit is contained in:
parent
4d22a22f92
commit
8788c109fa
@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.5] - 2023-11-02
|
||||
- update readme.md
|
||||
- update keywords.txt (align)
|
||||
|
||||
|
||||
## [0.2.5] - 2023-03-25
|
||||
- add **setDutyCycle()**, **getDutyCycle()**
|
||||
- implement duty cycle for square(), triangle() and random()
|
||||
@ -17,7 +22,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- update license 2023
|
||||
- minor edits
|
||||
|
||||
|
||||
## [0.2.4] - 2022-11-07
|
||||
- add changelog.md
|
||||
- add rp2040 to build-CI
|
||||
|
@ -2,14 +2,14 @@
|
||||
//
|
||||
// FILE: functionGenerator.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.5
|
||||
// VERSION: 0.2.6
|
||||
// PURPOSE: wave form generating functions (use with care)
|
||||
// URL: https://github.com/RobTillaart/FunctionGenerator
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define FUNCTIONGENERATOR_LIB_VERSION (F("0.2.5"))
|
||||
#define FUNCTIONGENERATOR_LIB_VERSION (F("0.2.6"))
|
||||
|
||||
|
||||
class funcgen
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: functionGenerator.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.5
|
||||
// VERSION: 0.2.6
|
||||
// PURPOSE: wave form generating functions (use with care)
|
||||
// URL: https://github.com/RobTillaart/FunctionGenerator
|
||||
|
||||
@ -88,7 +88,7 @@ float funcgen::getYShift()
|
||||
|
||||
void funcgen::setDutyCycle(float dutyCycle)
|
||||
{
|
||||
// negative dutyCycle? => 1-dc? or abs()?
|
||||
// negative dutyCycle? => 1-dc? or abs()?
|
||||
if (dutyCycle < 0) _dutyCycle = 0.0;
|
||||
else if (dutyCycle > 100) _dutyCycle = 1.0;
|
||||
else _dutyCycle = dutyCycle * 0.01;
|
||||
@ -225,7 +225,7 @@ float funcgen::stair(float t, uint16_t steps, uint8_t mode)
|
||||
|
||||
float funcgen::random()
|
||||
{
|
||||
float rv = _yShift + _amplitude * _random() * 0.2328306436E-9; // div 0xFFFFFFFF
|
||||
float rv = _yShift + _amplitude * _random() * 0.2328306436E-9; // div 0xFFFFFFFF
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Syntax Colouring Map for funcgen
|
||||
# Syntax Colouring Map for functionGenerator
|
||||
|
||||
# Data types (KEYWORD1)
|
||||
funcgen KEYWORD1
|
||||
@ -21,17 +21,18 @@ getDutyCycle KEYWORD2
|
||||
|
||||
setRandomSeed KEYWORD2
|
||||
|
||||
sawtooth KEYWORD2
|
||||
triangle KEYWORD2
|
||||
square KEYWORD2
|
||||
|
||||
sinus KEYWORD2
|
||||
stair KEYWORD2
|
||||
random KEYWORD2
|
||||
random_DC KEYWORD2
|
||||
|
||||
line KEYWORD2
|
||||
zero KEYWORD2
|
||||
|
||||
sawtooth KEYWORD2
|
||||
triangle KEYWORD2
|
||||
square KEYWORD2
|
||||
sinus KEYWORD2
|
||||
stair KEYWORD2
|
||||
|
||||
random KEYWORD2
|
||||
random_DC KEYWORD2
|
||||
|
||||
|
||||
# Constants (LITERAL1)
|
||||
FUNCTIONGENERATOR_LIB_VERSION LITERAL1
|
||||
|
@ -15,9 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/FunctionGenerator"
|
||||
},
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.6",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"headers": "functionGenerator.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=FunctionGenerator
|
||||
version=0.2.5
|
||||
version=0.2.6
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library to generate wave forms (nummeric) for a DAC
|
||||
|
@ -2,8 +2,11 @@
|
||||
[![Arduino CI](https://github.com/RobTillaart/FunctionGenerator/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/FunctionGenerator/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/FunctionGenerator/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/FunctionGenerator/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/FunctionGenerator/actions/workflows/jsoncheck.yml)
|
||||
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/FunctionGenerator.svg)](https://github.com/RobTillaart/FunctionGenerator/issues)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/FunctionGenerator/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/FunctionGenerator.svg?maxAge=3600)](https://github.com/RobTillaart/FunctionGenerator/releases)
|
||||
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/FunctionGenerator.svg)](https://registry.platformio.org/libraries/robtillaart/FunctionGenerator)
|
||||
|
||||
|
||||
# FunctionGenerator
|
||||
@ -225,3 +228,13 @@ Feedback and ideas are welcome.
|
||||
- **float stairDC()**
|
||||
- Bezier curve? (too complex)
|
||||
- record a signal and play back ==> separate class
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
If you appreciate my libraries, you can support the development and maintenance.
|
||||
Improve the quality of the libraries by providing issues and Pull Requests, or
|
||||
donate through PayPal or GitHub sponsors.
|
||||
|
||||
Thank you,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user