Page 1 of 1

ESP32 sharp dust sensor and wifi?

Posted: Wed Oct 30, 2019 9:49 pm
by 13ensz
Hello Everyone!

I've been struggling for days trying to get both work together however, I've seen online when WIFI is in use only pins 32-36 become available? is this true?

Code: Select all

/**
 * Example for using GP2Y1010AU0F Dust Sensor library
 * Created by Mickey Chan
 */

#include <GP2Y1010AU0F.h>

int measurePin = 26;   // Connect dust sensor analog measure pin to esp32 26 pin
int ledPin     = 27;    // Connect dust sensor LED pin to esp32 pin 27

GP2Y1010AU0F dustSensor(ledPin, measurePin); // Construct dust sensor global object
float dustDensity = 0;

void setup() {
  Serial.begin(115200);
  Serial.println(F("GP2Y1010AU0F Dust Sensor Library Example"));

  dustSensor.begin();
}

void loop() {
  dustDensity = dustSensor.read();
  
  Serial.print("Dust Density = ");
  Serial.print(dustDensity);
  Serial.println(" ug/m3");

  delay(5000);
}

Re: ESP32 sharp dust sensor and wifi?

Posted: Thu Oct 31, 2019 2:23 am
by WiFive
Yes, only 32-39 can be used as analog pins with WiFi.

Re: ESP32 sharp dust sensor and wifi?

Posted: Thu Oct 31, 2019 10:20 am
by 13ensz
WiFive wrote:
Thu Oct 31, 2019 2:23 am
Yes, only 32-39 can be used as analog pins with WiFi.
But the dust sensor only works with pins 26/27