luciansabo / gp2ydustsensor Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
An extra 40 micro seconds (320-280) LED on time is probably required after taking reading from analogRead before it's turned off.
uint16_t GP2YDustSensor::readDustRawOnce(uint16_t waitMicroSecs)
{
// Turn on the dust sensor LED by setting digital pin LOW.
digitalWrite(this->ledOutputPin, LOW);
// Wait 0.28ms before taking a reading of the output voltage as per spec.
delayMicroseconds(waitMicroSecs);
// Record the output voltage. This operation takes around 100 microseconds.
uint16_t VoRaw = analogRead(this->analogReadPin);
// Turn the dust sensor LED off by setting digital pin HIGH.
digitalWrite(this->ledOutputPin, HIGH);
return VoRaw;
}
Hi,
I'm using another library (https://github.com/emelianov/modbus-esp8266/releases) and it seems they are not "compatible".
Whenever dustSensor.begin(); is executed the other library is not working (no communication can be done over MODBUS RTU).
Do you know of an easy fix to allow for these libraries to work together?
Compile error
define
uint16_t dustAverage;
also i is not init
for (int i; i <= 100; i++) {
On ESP8266 board, A0 is 3.3V for 1024 (10bit). Is it correct to say that we need to set calibrationFactor to 3.3/5.0?
float scaledVoltage = avgRaw * (5.0 / 1024) * calibrationFactor;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.