Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoT_Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
robert.sharp
IoT_Project
Commits
0329c956
Commit
0329c956
authored
Jan 06, 2022
by
robert.sharp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete AirQuality_Sensor.ino
parent
1cbf2e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
AirQuality_Sensor.ino
...y_sensor/examples/AirQuality_Sensor/AirQuality_Sensor.ino
+0
-44
No files found.
libraries/Grove_-_Air_quality_sensor/examples/AirQuality_Sensor/AirQuality_Sensor.ino
deleted
100644 → 0
View file @
1cbf2e39
/*
AirQuality Demo V1.0.
connect to A1 to start testing. it will needs about 20s to start
* By: http://www.seeedstudio.com
*/
#include"AirQuality.h"
#include"Arduino.h"
AirQuality
airqualitysensor
;
int
current_quality
=-
1
;
void
setup
()
{
Serial
.
begin
(
9600
);
airqualitysensor
.
init
(
A0
);
}
void
loop
()
{
current_quality
=
airqualitysensor
.
slope
();
if
(
current_quality
>=
0
)
// if a valid data returned.
{
if
(
current_quality
==
0
)
Serial
.
println
(
"High pollution! Force signal active"
);
else
if
(
current_quality
==
1
)
Serial
.
println
(
"High pollution!"
);
else
if
(
current_quality
==
2
)
Serial
.
println
(
"Low pollution!"
);
else
if
(
current_quality
==
3
)
Serial
.
println
(
"Fresh air"
);
}
}
ISR
(
TIMER2_OVF_vect
)
{
if
(
airqualitysensor
.
counter
==
122
)
//set 2 seconds as a detected duty
{
airqualitysensor
.
last_vol
=
airqualitysensor
.
first_vol
;
airqualitysensor
.
first_vol
=
analogRead
(
A0
);
airqualitysensor
.
counter
=
0
;
airqualitysensor
.
timer_index
=
1
;
PORTB
=
PORTB
^
0x20
;
}
else
{
airqualitysensor
.
counter
++
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment