Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
7d7b28f7
Commit
7d7b28f7
authored
Feb 04, 2021
by
Derick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
averaging adc value of differential pressure over a breath cycle and displaying it instead of FiO2
parent
ff1f0719
Pipeline
#885
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
BreathingLoop.cpp
arduino/hev_prototype_v1/src/BreathingLoop.cpp
+9
-6
BreathingLoop.h
arduino/hev_prototype_v1/src/BreathingLoop.h
+1
-0
No files found.
arduino/hev_prototype_v1/src/BreathingLoop.cpp
View file @
7d7b28f7
...
...
@@ -95,7 +95,7 @@ BreathingLoop::BreathingLoop()
_sum_airway_pressure
=
0
;
_ap_readings_N
=
0
;
_readings_N_ADC
=
0
;
_running_index
=
0
;
_running_index_peep
=
0
;
...
...
@@ -197,8 +197,9 @@ void BreathingLoop::updateReadings()
_readings_sums
.
temperature_buffer
+=
static_cast
<
float
>
(
analogRead
(
pin_temperature_buffer
)
);
_readings_sums
.
pressure_o2_regulated
+=
static_cast
<
float
>
(
analogRead
(
pin_pressure_o2_regulated
)
);
_readings_sums
.
pressure_diff_patient
+=
static_cast
<
float
>
(
analogRead
(
pin_pressure_diff_patient
)
);
_readings_sums
.
o2_percent
+=
static_cast
<
float
>
(
analogRead
(
pin_o2_sensor
)
);
// CHANGED
_readings_sums
.
o2_percent
+=
static_cast
<
float
>
(
analogRead
(
pin_pressure_diff_patient
)
);
_readings_N_ADC
++
;
}
...
...
@@ -277,13 +278,13 @@ void BreathingLoop::updateCycleReadings()
if
(
_bl_state
==
BL_STATES
::
BUFF_PRE_INHALE
){
if
(
_cycle_done
==
false
){
logMsg
(
"hello
\n
"
);
logMsg
(
"hello
\n
"
);
uint32_t
tnow
=
static_cast
<
uint32_t
>
(
millis
());
_cycle_index
=
(
_cycle_index
==
CYCLE_AVG_READINGS
-
1
)
?
0
:
_cycle_index
+
1
;
_cycle_readings
.
timestamp
=
tnow
;
_cycle_readings
.
fiO2_percent
=
_readings_avgs
.
o2_percent
;
// FIXME
_cycle_readings
.
fiO2_percent
=
_readings_sums
.
o2_percent
/
_readings_N_ADC
;
// FIXME
_running_inhale_minute_volume
[
_cycle_index
]
=
_volume_inhale
;
_running_exhale_minute_volume
[
_cycle_index
]
=
_volume_exhale
;
//logMsg(" I, E "+String(_volume_inhale)+ " "+String(_volume_exhale));
...
...
@@ -333,6 +334,8 @@ void BreathingLoop::updateCycleReadings()
//reset
_cycle_done
=
true
;
_readings_sums
.
o2_percent
=
0
;
_readings_N_ADC
=
0
;
}
/* } else if ((_bl_state == BL_STATES::IDLE ) || (_bl_state == BL_STATES::CALIBRATION ) || (_bl_state == BL_STATES::STOP) ){
_sum_airway_pressure = 0;
...
...
@@ -436,7 +439,7 @@ void BreathingLoop::resetReadingSums()
_readings_sums
.
pressure_o2_supply
=
0
;
_readings_sums
.
pressure_o2_regulated
=
0
;
_readings_sums
.
pressure_diff_patient
=
0
;
_readings_sums
.
o2_percent
=
0
;
//
_readings_sums.o2_percent = 0;
}
//This is used to assign the transitions of the fsm
...
...
arduino/hev_prototype_v1/src/BreathingLoop.h
View file @
7d7b28f7
...
...
@@ -168,6 +168,7 @@ private:
uint32_t
_readings_avgs_timeout
;
uint32_t
_readings_cycle_time
;
uint32_t
_readings_cycle_timeout
;
uint32_t
_readings_N_ADC
;
uint32_t
_tsig_time
;
uint32_t
_tsig_timeout
;
uint32_t
_calculations_time
;
...
...
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