ESP32 sharp dust sensor and wifi?

13ensz
Posts: 3
Joined: Wed Oct 30, 2019 9:41 pm

ESP32 sharp dust sensor and wifi?

Postby 13ensz » Wed Oct 30, 2019 9:49 pm

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);
}

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 sharp dust sensor and wifi?

Postby WiFive » Thu Oct 31, 2019 2:23 am

Yes, only 32-39 can be used as analog pins with WiFi.

13ensz
Posts: 3
Joined: Wed Oct 30, 2019 9:41 pm

Re: ESP32 sharp dust sensor and wifi?

Postby 13ensz » Thu Oct 31, 2019 10:20 am

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

Who is online

Users browsing this forum: Google [Bot] and 87 guests