Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full consolidation of "phase locking" and "PWM locking" waveform generators #8011

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

dok-net
Copy link
Contributor

@dok-net dok-net commented May 1, 2021

This now needs review and testing.
At time of publishing, the following MCVE works for eyes and ears, not tested with an oscilloscope by myself yet:

#include <PolledTimeout.h>

#ifndef D5
#define D5 (14)
#endif

uint8_t brightness = 255;
uint8_t brightnessAdj = 1;

void setup()
{
    tone(D5, 440, 3 * 2560);
    analogWrite(LED_BUILTIN, brightness);
}

esp8266::polledTimeout::periodicMs changeBrightness(10);

void loop()
{
    if (changeBrightness)
    {
        if (!brightness || !static_cast<uint8_t>(~brightness))
        {
            brightnessAdj = ~brightnessAdj;
            ++brightnessAdj;
        }
        brightness += brightnessAdj;
        analogWrite(LED_BUILTIN, brightness);
    }
}

Fixes #8081.

@dok-net dok-net force-pushed the mergepwm branch 5 times, most recently from 255baa3 to 1579b85 Compare May 1, 2021 20:38
@dok-net dok-net force-pushed the mergepwm branch 7 times, most recently from 42089c6 to 24f77b9 Compare May 3, 2021 17:30
@dok-net dok-net changed the title [WIP] Full consolidation of "phase locking" and "PMW locking" waveform generators Full consolidation of "phase locking" and "PMW locking" waveform generators May 3, 2021
@dok-net dok-net force-pushed the mergepwm branch 7 times, most recently from c6b902b to 92d1d4a Compare May 19, 2021 08:34
@dok-net dok-net force-pushed the mergepwm branch 6 times, most recently from 166f61f to 69448a9 Compare June 6, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Servo lib has 15ms delay since ESP8266 V3.0.0
1 participant