Commit 90ae8d68 authored by Gayan Kavinda Gamlath's avatar Gayan Kavinda Gamlath 😂

Dust Update Code

parent a1f6cf0e
...@@ -25,4 +25,6 @@ void loop() { ...@@ -25,4 +25,6 @@ void loop() {
digitalWrite(ledPower,HIGH); /*LED should be pulsed on once every 10ms. It means LED start to blinking*/ digitalWrite(ledPower,HIGH); /*LED should be pulsed on once every 10ms. It means LED start to blinking*/
delayMicroseconds(sleepTime); /*Sleep time because 10ms cycle = 10000 - 280 - 40 = 9680 microseconds. It means this delay loop in 1 sec*/ delayMicroseconds(sleepTime); /*Sleep time because 10ms cycle = 10000 - 280 - 40 = 9680 microseconds. It means this delay loop in 1 sec*/
calcVoltage = voMeasured*(5.0/1024); /* 0 - 5.0V mapped to 0 - 1023 integer values (if you use 3.3V, map 0 - 3.3V to 0 - 1023) */
dustDensity = 0.17*calcVoltage-0.1; /* Using linear eqaution for calculate Dust Density*/
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment