Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SmartHome
NodeManager_BME280_EasyPCB
Commits
39fbc856
Commit
39fbc856
authored
May 12, 2017
by
user2684
Browse files
delay() replaced with wait()
parent
ce0b430f
Changes
1
Hide whitespace changes
Inline
Side-by-side
NodeManager.cpp
View file @
39fbc856
...
...
@@ -22,7 +22,7 @@ float getVcc() {
ADMUX
=
(
_BV
(
REFS0
)
|
_BV
(
MUX3
)
|
_BV
(
MUX2
)
|
_BV
(
MUX1
));
#endif
// Vref settle
delay
(
70
);
wait
(
70
);
// Do conversion
ADCSRA
|=
_BV
(
ADSC
);
while
(
bit_is_set
(
ADCSRA
,
ADSC
))
{};
...
...
@@ -681,7 +681,7 @@ float SensorMQ::_MQCalibration() {
//take multiple samples
for
(
i
=
0
;
i
<
_calibration_sample_times
;
i
++
)
{
val
+=
_MQResistanceCalculation
(
analogRead
(
_pin
));
delay
(
_calibration_sample_interval
);
wait
(
_calibration_sample_interval
);
}
//calculate the average value
val
=
val
/
_calibration_sample_times
;
...
...
@@ -697,7 +697,7 @@ float SensorMQ::_MQRead() {
float
rs
=
0
;
for
(
i
=
0
;
i
<
_read_sample_times
;
i
++
)
{
rs
+=
_MQResistanceCalculation
(
analogRead
(
_pin
));
delay
(
_read_sample_interval
);
wait
(
_read_sample_interval
);
}
rs
=
rs
/
_read_sample_times
;
return
rs
;
...
...
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