Skip to content

analogRead forces WiFi to disconnect #1634

Closed
@renno-bih

Description

@renno-bih

Hello,
I'm trying to make sound detection with my esp8266 and this is part of code I'm using:

sample = analogRead(NOISE_SENSOR);
if (sample < 1024) // toss out spurious readings
{
if (sample > signalMax)
{
signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
signalMin = sample; // save just the min levels
}
}

Every 10-20 seconds WiFi disconnects. When I use delay(3); after analogRead it works without disconnecting WiFi but with this delay I don't get enough samples.
Any idea what I'm doing wrong?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions