Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Detection of Breathing with Maternity Smart Belt for IoT Smart Baby Rocker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syed Muhammad Shahzeb Hassan
Detection of Breathing with Maternity Smart Belt for IoT Smart Baby Rocker
Commits
da65577a
Commit
da65577a
authored
1 month ago
by
Syed Muhammad Shahzeb Hassan
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
735ea182
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Trans_test_data.ino
+34
-0
34 additions, 0 deletions
Trans_test_data.ino
with
34 additions
and
0 deletions
Trans_test_data.ino
0 → 100644
+
34
−
0
View file @
da65577a
#include
<Wire.h>
#include
<Adafruit_Sensor.h>
#include
<Adafruit_ADXL345_U.h>
// Create an instance of the ADXL345 accelerometer
Adafruit_ADXL345_Unified
accel
=
Adafruit_ADXL345_Unified
(
12345
);
void
setup
()
{
Serial
.
begin
(
9600
);
// Initialize accelerometer
if
(
!
accel
.
begin
())
{
Serial
.
println
(
"Could not find a valid ADXL345 sensor, check wiring!"
);
while
(
1
);
}
accel
.
setRange
(
ADXL345_RANGE_2_G
);
// Set range to ±2G
// Print CSV header
Serial
.
println
(
"Time(ms),Z-Value"
);
}
void
loop
()
{
sensors_event_t
event
;
accel
.
getEvent
(
&
event
);
// Get current time in milliseconds
unsigned
long
currentTime
=
millis
();
// Print time and Z-axis value in CSV format
Serial
.
print
(
currentTime
);
Serial
.
print
(
","
);
Serial
.
println
(
event
.
acceleration
.
z
,
4
);
// Z value with 4 decimal places
delay
(
100
);
// Adjust sampling rate as needed
}
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