Skip to content

Does not compile with ESP32 board library version 3.0 #10

Description

@buttim

It gives several compile errors related to the API changes to the LEDC functions.
I modified melody_player.cpp to make it work. Here is the diff output:

43c43
<       ledcWriteTone(pwmChannel, 0);
---
>       ledcWriteTone(pin, 0);
50c50
<       ledcWriteTone(pwmChannel, computedNote.frequency);
---
>       ledcWriteTone(pin, computedNote.frequency);
90c90
<       ledcWriteTone(player->pwmChannel, 0);
---
>       ledcWriteTone(player->pin, 0);
102c102
<       ledcWriteTone(player->pwmChannel, computedNote.frequency);
---
>       ledcWriteTone(player->pin, computedNote.frequency);
212,214c212,213
<   ledcSetup(pwmChannel, 2000, resolution);
<   ledcAttachPin(pin, pwmChannel);
<   ledcWrite(pwmChannel, 125);
---
>   ledcAttach(pin, 2000,resolution);
>   ledcWrite(pin, 125);
220,221c219,220
<   ledcWrite(pwmChannel, 0);
<   ledcDetachPin(pin);
---
>   ledcWrite(pin, 0);
>   ledcDetach(pin);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions