From 96605d630ca783e63199531c2ffdf7bfbb72596c Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sat, 3 Jan 2026 11:01:17 +0100 Subject: [PATCH] update GitHub actions + examples --- .github/workflows/arduino-lint.yml | 6 +++--- .github/workflows/arduino_test_runner.yml | 3 +-- .github/workflows/jsoncheck.yml | 4 +++- LICENSE | 2 +- README.md | 18 ++++++++++++------ .../funcGenFreeWavePlotter.ino | 3 ++- .../functionGenerator/functionGenerator.ino | 4 ++++ .../functionGeneratorDuoPlot.ino | 9 +++++---- .../functionGeneratorPerformance.ino | 3 ++- .../functionGeneratorPlotter.ino | 5 +++-- .../functionGenerator_MCP4725.ino | 8 ++++++++ .../functionGenerator_double_MCP4725.ino | 2 ++ examples/generateFreeWave/generateFreeWave.ino | 7 ++++++- functionGenerator.cpp | 3 ++- functionGenerator.h | 5 +++-- library.json | 2 +- library.properties | 2 +- 17 files changed, 59 insertions(+), 27 deletions(-) diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml index 7b28949..aed264b 100644 --- a/.github/workflows/arduino-lint.yml +++ b/.github/workflows/arduino-lint.yml @@ -6,8 +6,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 - - uses: arduino/arduino-lint-action@v1 + - uses: actions/checkout@v6 + - uses: arduino/arduino-lint-action@v2 with: library-manager: update - # compliance: strict + compliance: strict \ No newline at end of file diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml index dbd0ce7..a2a5f07 100644 --- a/.github/workflows/arduino_test_runner.yml +++ b/.github/workflows/arduino_test_runner.yml @@ -6,9 +6,8 @@ jobs: runTest: runs-on: ubuntu-latest timeout-minutes: 20 - steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml index 1cbb5e2..2c52dc7 100644 --- a/.github/workflows/jsoncheck.yml +++ b/.github/workflows/jsoncheck.yml @@ -5,13 +5,15 @@ on: paths: - '**.json' pull_request: + paths: + - '**.json' jobs: test: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: json-syntax-check uses: limitusus/json-syntax-check@v2 with: diff --git a/LICENSE b/LICENSE index 3b61d73..f85ccba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2015-2024 Rob Tillaart +Copyright (c) 2015-2026 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6c109fe..da2f79e 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ It is advised to reset **t** after a number (e.g. 100) full periods Needs further investigations. + ### Related - https://github.com/RobTillaart/AD9833 hardware waveform generator. @@ -209,6 +210,7 @@ The rising and falling edges stay same. - **float heartBeat(float t)** The duty cycle determines the part of the period that the signal ~zero. + ### No duty cycle The other functions need to be investigated what duty cycle means. @@ -224,6 +226,7 @@ Think of it as the halve of the triangle wave. - **float sinusRectified(float t)** - **float freeWave(float t, int16_t arr, int16_t N)** + ## Future #### Must @@ -240,6 +243,7 @@ Think of it as the halve of the triangle wave. - stand-alone functions in separate .h - clean up code + #### Could - ASDR wave @@ -254,6 +258,7 @@ Think of it as the halve of the triangle wave. - improve performance sin() lookup table. - add float variable for ```_perDC = _period * _dutyCycle``` - do we need **freq4** ? not since DC. + - check **FastTrig** library for faster sinus (interpolated lookup). - heartBeat - small noise/variation parameter on amplitude and frequency. - reduce footprint ==> wrapper around freeWave() @@ -266,15 +271,16 @@ Think of it as the halve of the triangle wave. - create an example program to sample an arbitrary wave form - output in the right format. - slow sampling vs real time. - +- functionGenerator as (derived?) class name #### Examples - - Amplitude modulation ? - - heartbeat curve? - - example ESP32 version as separate task. - - example with DAC. 8 12 16 bit. - - example with potentiometers for 4 parameters +- Amplitude modulation ? +- heartbeat curve? +- example ESP32 version as separate task. +- example with DAC. 8 12 16 bit. +- example with potentiometers for 4 parameters + #### Wont diff --git a/examples/funcGenFreeWavePlotter/funcGenFreeWavePlotter.ino b/examples/funcGenFreeWavePlotter/funcGenFreeWavePlotter.ino index b0df55e..e809a46 100644 --- a/examples/funcGenFreeWavePlotter/funcGenFreeWavePlotter.ino +++ b/examples/funcGenFreeWavePlotter/funcGenFreeWavePlotter.ino @@ -67,8 +67,9 @@ int16_t arr_two_sin[101] = void setup() { Serial.begin(115200); + // Serial.println(); // Serial.println(__FILE__); - // Serial.print("FUNCTIONGENERATOR_LIB_VERSION: "); + // Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); // Serial.println(FUNCTIONGENERATOR_LIB_VERSION); // Serial.println(); diff --git a/examples/functionGenerator/functionGenerator.ino b/examples/functionGenerator/functionGenerator.ino index 2cd6c50..9f4178a 100644 --- a/examples/functionGenerator/functionGenerator.ino +++ b/examples/functionGenerator/functionGenerator.ino @@ -18,7 +18,11 @@ char choice = '0'; void setup() { Serial.begin(500000); + Serial.println(); Serial.println(__FILE__); + Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); + Serial.println(FUNCTIONGENERATOR_LIB_VERSION); + Serial.println(); Serial.println("Start "); gen.setFrequency(4); diff --git a/examples/functionGeneratorDuoPlot/functionGeneratorDuoPlot.ino b/examples/functionGeneratorDuoPlot/functionGeneratorDuoPlot.ino index 33372f6..0409c77 100644 --- a/examples/functionGeneratorDuoPlot/functionGeneratorDuoPlot.ino +++ b/examples/functionGeneratorDuoPlot/functionGeneratorDuoPlot.ino @@ -17,10 +17,11 @@ funcgen gen2; void setup() { Serial.begin(115200); - // Serial.println(); - // Serial.println(__FILE__); - // Serial.print("FUNCTIONGENERATOR_LIB_VERSION: "); - // Serial.println(FUNCTIONGENERATOR_LIB_VERSION); + // Serial.println(); + // Serial.println(__FILE__); + // Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); + // Serial.println(FUNCTIONGENERATOR_LIB_VERSION); + // Serial.println(); gen1.setFrequency(13); gen1.setAmplitude(50); diff --git a/examples/functionGeneratorPerformance/functionGeneratorPerformance.ino b/examples/functionGeneratorPerformance/functionGeneratorPerformance.ino index a8d55e2..c6a3c79 100644 --- a/examples/functionGeneratorPerformance/functionGeneratorPerformance.ino +++ b/examples/functionGeneratorPerformance/functionGeneratorPerformance.ino @@ -46,8 +46,9 @@ int16_t arr_two_sin[101] = void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); - Serial.print("FUNCTIONGENERATOR_LIB_VERSION: "); + Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); Serial.println(FUNCTIONGENERATOR_LIB_VERSION); Serial.println(); diff --git a/examples/functionGeneratorPlotter/functionGeneratorPlotter.ino b/examples/functionGeneratorPlotter/functionGeneratorPlotter.ino index 3bf50dc..31a844e 100644 --- a/examples/functionGeneratorPlotter/functionGeneratorPlotter.ino +++ b/examples/functionGeneratorPlotter/functionGeneratorPlotter.ino @@ -17,18 +17,19 @@ funcgen gen2; void setup() { Serial.begin(115200); + // Serial.println(); // Serial.println(__FILE__); // Serial.print("FUNCTIONGENERATOR_LIB_VERSION: "); // Serial.println(FUNCTIONGENERATOR_LIB_VERSION); // Serial.println(); gen.setAmplitude(80); - gen.setFrequency(65.0 / 60.0); // HB = BPM/60.0 + gen.setFrequency(65.0 / 60.0); // HB = BPM/60.0 gen.setDutyCycle(40); gen2.setYShift(+20); gen2.setAmplitude(80); - gen2.setFrequency(120.0 / 60.0); // HB = BPM/60.0 + gen2.setFrequency(120.0 / 60.0); // HB = BPM/60.0 gen2.setDutyCycle(80); gen2.setYShift(-80); } diff --git a/examples/functionGenerator_MCP4725/functionGenerator_MCP4725.ino b/examples/functionGenerator_MCP4725/functionGenerator_MCP4725.ino index 3e31c48..095104d 100644 --- a/examples/functionGenerator_MCP4725/functionGenerator_MCP4725.ino +++ b/examples/functionGenerator_MCP4725/functionGenerator_MCP4725.ino @@ -8,6 +8,8 @@ // depending on the platform, the range of "smooth" sinus is limited. // other signals are less difficult so have a slightly larger range. // see readme.md for mac frequency table. +// +// uses an MCP4725 as output device #include "functionGenerator.h" @@ -37,6 +39,12 @@ uint32_t lastTime = 0; void setup() { Serial.begin(230400); + Serial.println(); + Serial.println(__FILE__); + Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); + Serial.println(FUNCTIONGENERATOR_LIB_VERSION); + Serial.println(); + gen.setAmplitude(1); gen.setYShift(1); gen.setFrequency(frequency); diff --git a/examples/functionGenerator_double_MCP4725/functionGenerator_double_MCP4725.ino b/examples/functionGenerator_double_MCP4725/functionGenerator_double_MCP4725.ino index b08269d..a88499e 100644 --- a/examples/functionGenerator_double_MCP4725/functionGenerator_double_MCP4725.ino +++ b/examples/functionGenerator_double_MCP4725/functionGenerator_double_MCP4725.ino @@ -31,6 +31,8 @@ void setup() Serial.begin(230400); Serial.println(); Serial.println(__FILE__); + Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); + Serial.println(FUNCTIONGENERATOR_LIB_VERSION); Serial.println(); Wire.begin(); diff --git a/examples/generateFreeWave/generateFreeWave.ino b/examples/generateFreeWave/generateFreeWave.ino index 6bdb4bc..46f9b1c 100644 --- a/examples/generateFreeWave/generateFreeWave.ino +++ b/examples/generateFreeWave/generateFreeWave.ino @@ -5,11 +5,16 @@ // URL: https://github.com/RobTillaart/FunctionGenerator +#include "functionGenerator.h" + + void setup() { Serial.begin(115200); - Serial.println(__FILE__); Serial.println(); + Serial.println(__FILE__); + Serial.println("FUNCTIONGENERATOR_LIB_VERSION: "); + Serial.println(FUNCTIONGENERATOR_LIB_VERSION); Serial.println(); Serial.println("int16_t arr[101] =\n{"); diff --git a/functionGenerator.cpp b/functionGenerator.cpp index 7210847..e5d9597 100644 --- a/functionGenerator.cpp +++ b/functionGenerator.cpp @@ -1,7 +1,8 @@ // // FILE: functionGenerator.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.0 +// VERSION: 0.3.1 +// DATE: 2015-01-01 // PURPOSE: wave form generating functions (use with care) // URL: https://github.com/RobTillaart/FunctionGenerator diff --git a/functionGenerator.h b/functionGenerator.h index 6407702..8f88722 100644 --- a/functionGenerator.h +++ b/functionGenerator.h @@ -2,14 +2,15 @@ // // FILE: functionGenerator.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.0 +// VERSION: 0.3.1 +// DATE: 2015-01-01 // PURPOSE: wave form generating functions (use with care) // URL: https://github.com/RobTillaart/FunctionGenerator #include "Arduino.h" -#define FUNCTIONGENERATOR_LIB_VERSION (F("0.3.0")) +#define FUNCTIONGENERATOR_LIB_VERSION (F("0.3.1")) class funcgen diff --git a/library.json b/library.json index 584cc6e..37c47a2 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/FunctionGenerator" }, - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 0ff4034..874b610 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=FunctionGenerator -version=0.3.0 +version=0.3.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library to generate wave forms (nummeric) for a DAC