Commit c919cdb1 by satsob

nRF Robot Stuff

parent da0e7d83
#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(".");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment