Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
F23-BLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pragya.anur@duke.edu
F23-BLE
Commits
24fdfae1
Commit
24fdfae1
authored
1 year ago
by
pragya.anur@duke.edu
Browse files
Options
Downloads
Patches
Plain Diff
final submission
parent
45c92794
Branches
main
No related tags found
No related merge requests found
Pipeline
#459919
passed
1 year ago
Stage: build
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
#winning.PNG
+0
-0
0 additions, 0 deletions
#winning.PNG
BLE Analysis.ipynb
+246
-9
246 additions, 9 deletions
BLE Analysis.ipynb
BLE State Diagram.png
+0
-0
0 additions, 0 deletions
BLE State Diagram.png
led1_data.csv
+16
-0
16 additions, 0 deletions
led1_data.csv
src/main.c
+12
-14
12 additions, 14 deletions
src/main.c
with
274 additions
and
23 deletions
#winning.PNG
0 → 100644
+
0
−
0
View file @
24fdfae1
446 KiB
This diff is collapsed.
Click to expand it.
BLE Analysis.ipynb
+
246
−
9
View file @
24fdfae1
This diff is collapsed.
Click to expand it.
BLE State Diagram.png
0 → 100644
+
0
−
0
View file @
24fdfae1
167 KiB
This diff is collapsed.
Click to expand it.
led1_data.csv
0 → 100644
+
16
−
0
View file @
24fdfae1
100 HZ,Vpp,Brightness
10,0.85,10.69
10,0.89,10.74
10,0.98,10.89
20,1.15,11.14
20,1.23,11.18
20,1.43,11.63
30,1.68,11.95
30,1.75,12.36
30,1.89,12.22
40,2.35,13.43
40,2.42,13.51
40,2.55,13.65
50,3.61,15.61
50,3.51,16.15
50,3.66,15.67
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main.c
+
12
−
14
View file @
24fdfae1
...
...
@@ -141,7 +141,6 @@ float max_data_array2[PERIOD_ARRAY]={};
float
min_data_array2
[
PERIOD_ARRAY
]
=
{};
enum
data_outputs
{
LED1_Brightness
,
LED2_Brightness
,
Pressure
};
//int16_t data_output[3]= {};
int16_t
data_output
[
3
];
/******************************************************************************************/
//BLUETOOTH STUFF
...
...
@@ -235,8 +234,6 @@ struct bt_remote_srv_cb remote_service_callbacks = {
.
data_rx
=
on_data_rx
,
};
//int16_t compliance_data; //going to have to change to a enum that holds 3 data values in an array
/******************************************************************************************/
static
const
struct
adc_dt_spec
vadc_battery
=
ADC_DT_SPEC_GET_BY_ALIAS
(
vadc
);
...
...
@@ -389,14 +386,14 @@ static void idle_run(void *o)
{
//LOG_INF("IDLE RUN");
//
float atm_pressure_kPa = read_pressure_sensor(pressure_in, OVERSAMPLE, 0);
//
data_output[
p
ressure] = atm_kPa;
//
k_msleep(MEASUREMENT_DELAY_MS);
float
atm_pressure_kPa
=
read_pressure_sensor
(
pressure_in
,
OVERSAMPLE
,
0
);
data_output
[
P
ressure
]
=
atm_
pressure_
kPa
;
k_msleep
(
MEASUREMENT_DELAY_MS
);
//
if (atm_pressure_kPa <= 0)
//
{
//
smf_set_state(SMF_CTX(&s_obj), &states[Pressure_Error]);
//
}
if
(
atm_pressure_kPa
<=
0
)
{
smf_set_state
(
SMF_CTX
(
&
s_obj
),
&
states
[
Pressure_Error
]);
}
usbregstatus
=
nrf_power_usbregstatus_vbusdet_get
(
NRF_POWER
);
if
(
usbregstatus
==
true
)
...
...
@@ -421,7 +418,7 @@ static void action_run(void *o)
k_timer_start
(
&
led_timer
,
K_MSEC
(
100
),
K_MSEC
(
100
));
k_timer_start
(
&
led2_timer
,
K_MSEC
(
100
),
K_MSEC
(
100
));
//
atm_pressure_kPa = read_pressure_sensor(pressure_in, OVERSAMPLE, 0);
atm_pressure_kPa
=
read_pressure_sensor
(
pressure_in
,
OVERSAMPLE
,
0
);
//LOG_INF("Pressure: %lld", atm_pressure_kPa);
}
...
...
@@ -899,9 +896,10 @@ void button2_work_handler(struct k_work *button1_work)
// this function retrieves BAS GATT with information
battery_level
=
bt_bas_get_battery_level
();
data_output
[
LED1_Brightness
]
=
50
;
data_output
[
LED2_Brightness
]
=
90
;
data_output
[
Pressure
]
=
102
;
//used these values to check if bluetooth was working with hard coded values
// data_output[LED1_Brightness]=50;
// data_output[LED2_Brightness]=90;
// data_output[Pressure]=102;
LOG_INF
(
"LED1 Brightness :%d"
,
data_output
[
LED1_Brightness
]);
LOG_INF
(
"LED2 Brightness :%d"
,
data_output
[
LED2_Brightness
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment