Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
RF24
Commits
58f6d8db
Commit
58f6d8db
authored
Feb 06, 2016
by
Avamander
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #200 from SaintGimp/FixGettingStarted
Fix GettingStarted sample
parents
95926b2c
81f1c0d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
examples/GettingStarted/GettingStarted.ino
examples/GettingStarted/GettingStarted.ino
+5
-5
No files found.
examples/GettingStarted/GettingStarted.ino
View file @
58f6d8db
...
@@ -56,8 +56,8 @@ if (role == 1) {
...
@@ -56,8 +56,8 @@ if (role == 1) {
Serial
.
println
(
F
(
"Now sending"
));
Serial
.
println
(
F
(
"Now sending"
));
unsigned
long
time
=
micros
();
// Take the time, and send it. This will block until complete
unsigned
long
start_
time
=
micros
();
// Take the time, and send it. This will block until complete
if
(
!
radio
.
write
(
&
time
,
sizeof
(
unsigned
long
)
)){
if
(
!
radio
.
write
(
&
start_
time
,
sizeof
(
unsigned
long
)
)){
Serial
.
println
(
F
(
"failed"
));
Serial
.
println
(
F
(
"failed"
));
}
}
...
@@ -78,15 +78,15 @@ if (role == 1) {
...
@@ -78,15 +78,15 @@ if (role == 1) {
}
else
{
}
else
{
unsigned
long
got_time
;
// Grab the response, compare, and send to debugging spew
unsigned
long
got_time
;
// Grab the response, compare, and send to debugging spew
radio
.
read
(
&
got_time
,
sizeof
(
unsigned
long
)
);
radio
.
read
(
&
got_time
,
sizeof
(
unsigned
long
)
);
unsigned
long
time
=
micros
();
unsigned
long
end_
time
=
micros
();
// Spew it
// Spew it
Serial
.
print
(
F
(
"Sent "
));
Serial
.
print
(
F
(
"Sent "
));
Serial
.
print
(
time
);
Serial
.
print
(
start_
time
);
Serial
.
print
(
F
(
", Got response "
));
Serial
.
print
(
F
(
", Got response "
));
Serial
.
print
(
got_time
);
Serial
.
print
(
got_time
);
Serial
.
print
(
F
(
", Round-trip delay "
));
Serial
.
print
(
F
(
", Round-trip delay "
));
Serial
.
print
(
time
-
go
t_time
);
Serial
.
print
(
end_time
-
star
t_time
);
Serial
.
println
(
F
(
" microseconds"
));
Serial
.
println
(
F
(
" microseconds"
));
}
}
...
...
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