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