Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
satsob
/
Robotite_ylesannete_projekt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c919cdb1
authored
Oct 07, 2020
by
satsob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nRF Robot Stuff
parent
da0e7d83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
nRF_BTLE_ReceiveData/nRF_BTLE_SendData/nRF_BTLE_SendData.ino
nRF_BTLE_ReceiveData/nRF_BTLE_SendData/nRF_BTLE_SendData.ino
0 → 100644
View file @
c919cdb1
#include <SPI.h>
#include <RF24.h>
#include <BTLE.h>
RF24
radio
(
9
,
10
);
BTLE
btle
(
&
radio
);
void
setup
()
{
Serial
.
begin
(
9600
);
while
(
!
Serial
)
{
}
Serial
.
println
(
"BTLE advertisement sender"
);
btle
.
begin
(
"foobar"
);
}
void
loop
()
{
float
temp
=
0.5
;
// Send battery level
// float temp = 30; // Send temperature
nrf_service_data
buf
;
// buf.service_uuid = NRF_DEVICE_INFORMATION_SERVICE_UUID; // 0x180A
// buf.service_uuid = NRF_TEMPERATURE_SERVICE_UUID; // 0x1809
buf
.
service_uuid
=
NRF_BATTERY_SERVICE_UUID
;
// 0x180F
buf
.
value
=
BTLE
::
to_nRF_Float
(
temp
);
btle
.
advertise
(
0x16
,
&
buf
,
sizeof
(
buf
));
// btle.advertise(0,0);
btle
.
hopChannel
();
Serial
.
print
(
"."
);
}
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