Skip to content

Tone.cpp - not working #6877

Closed
Closed
@stbaumg

Description

@stbaumg

Board

lolin 32 lite

Device Description

devkit

Hardware Configuration

Buzzer on PIN 25

Version

v2.0.3

IDE Name

Arduino

Operating System

ubuntu

Flash frequency

40MHz

PSRAM enabled

no

Upload speed

921600

Description

Line 37 and 38 needed to change place for my board to work

not working

        ledcWriteTone(_channel, tone_msg.frequency);
        ledcAttachPin(tone_msg.pin, _channel);

working:

        ledcAttachPin(tone_msg.pin, _channel);
        ledcWriteTone(_channel, tone_msg.frequency);

Sketch

#define BUZZERPIN 25

void setup() {

}

void loop() {
  tone(BUZZERPIN, 440,200);
  // wait _at least_ 200ms (tone duration) before playing next tone
  delay(1000); 
}

Debug Message

none

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions