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
bfc85e48
Commit
bfc85e48
authored
Mar 08, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pwm channel for debug. changed PCB_gain for O2 sensor.
parent
aadf8eb8
Pipeline
#1045
failed
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
nodemcu_32s_pinout.h
arduino/common/include/nodemcu_32s_pinout.h
+2
-2
.common.cpp.swp
arduino/hev_prototype_v1/src/.common.cpp.swp
+0
-0
BreathingLoop.cpp
arduino/hev_prototype_v1/src/BreathingLoop.cpp
+3
-2
common.cpp
arduino/hev_prototype_v1/src/common.cpp
+1
-1
No files found.
arduino/common/include/nodemcu_32s_pinout.h
View file @
bfc85e48
...
...
@@ -72,6 +72,6 @@ const int pwm_chan_exhale = 1;
const
int
pwm_resolution
=
16
;
// 8 bit resolution; up to 16 possible
const
int
pwm_frequency
=
500
;
// frequency in Hz
const
int
pwm_chan_debug
=
1
;
const
int
pwm_chan_debug
=
4
;
const
int
pwm_resolution_debug
=
8
;
// 8 bit resolution; up to 16 possible
const
int
pwm_frequency_debug
=
500
;
// frequency in Hz
\ No newline at end of file
const
int
pwm_frequency_debug
=
500
;
// frequency in Hz
arduino/hev_prototype_v1/src/.common.cpp.swp
0 → 100644
View file @
bfc85e48
File added
arduino/hev_prototype_v1/src/BreathingLoop.cpp
View file @
bfc85e48
...
...
@@ -289,12 +289,12 @@ void BreathingLoop::updateCycleReadings()
if
(
_bl_state
==
BL_STATES
::
BUFF_PRE_INHALE
){
if
(
_cycle_done
==
false
){
uint32_t
tnow
=
static_cast
<
uint32_t
>
(
millis
());
ledcWrite
(
pwm_chan_debug
,
uint8_t
(
_fiO2_est
*
255
));
ledcWrite
(
pwm_chan_debug
,
uint8_t
(
_fiO2_est
*
122
));
_cycle_index
=
(
_cycle_index
==
CYCLE_AVG_READINGS
-
1
)
?
0
:
_cycle_index
+
1
;
_cycle_readings
.
timestamp
=
tnow
;
_cycle_readings
.
fiO2_percent
=
_fiO2_est
*
100.
f
;
//_readings_avgs.o2_percent;// FIXME
_cycle_readings
.
fiO2_percent
=
_readings_avgs
.
o2_percent
;
//
_running_inhale_minute_volume
[
_cycle_index
]
=
_volume_inhale
;
_running_exhale_minute_volume
[
_cycle_index
]
=
_volume_exhale
;
_total_cycle_duration
[
_cycle_index
]
=
(
...
...
@@ -690,6 +690,7 @@ void BreathingLoop::assignFillFSM()
case
BL_STATES
:
:
EXHALE
:
if
(
_bl_laststate
!=
BL_STATES
::
EXHALE
){
_fill_state
=
determineFillMode
();
logMsg
(
"Fill state: "
+
String
(
_fill_state
));
}
break
;
case
BL_STATES
:
:
BUFF_FILL
:
...
...
arduino/hev_prototype_v1/src/common.cpp
View file @
bfc85e48
...
...
@@ -240,7 +240,7 @@ float adcToO2PercentFloat(float adc, float offset)
{
// calibration should flush air only (21% o2) or o2 only (100%) for N secs
float
PCB_Gain
=
5.
;
// real voltage is 4 times higher thant the measured in the PCB (there is a voltage divider)
float
PCB_Gain
=
5.
54
;
// real voltage is 4 times higher thant the measured in the PCB (there is a voltage divider)
float
Sensor_Gain
=
100.
/
10000.
;
// the sensor gain is 100 % / 10000 mVolts
float
ADC_to_Voltage_Gain
=
3300.
/
4096.0
;
// maximum Voltage of 3.3V for 4096 ADC counts - (It might need recalibration?)
float
ADC_to_mVoltage_Gain
=
0.788
;
// this is the measured gain
...
...
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