pxt-calliope/libs/microbit-bluetooth/bluetooth.cpp

34 lines
967 B
C++
Raw Normal View History

2016-06-14 15:30:07 +02:00
#include "pxt.h"
#include "MESEvents.h"
using namespace pxt;
//% color=#0082FB weight=20
2016-06-14 15:30:07 +02:00
namespace bluetooth {
/**
* Starts the Bluetooth IO pin service
*/
//% help=bluetooth/start-io-pin-service
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service"
2016-06-14 15:30:07 +02:00
void startIOPinService() {
new MicroBitIOPinService(*uBit.ble, uBit.io);
}
/**
* Starts the Bluetooth LED service
*/
//% help=bluetooth/start-led-service
//% blockId=bluetooth_start_led_service block="bluetooth led service"
void startLEDService() {
new MicroBitLEDService(*uBit.ble, uBit.display);
}
/**
* Starts the temperature service
*/
//% help=bluetooth/start-temperature-service
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service"
void startTemperatureService() {
new MicroBitTemperatureService(*uBit.ble, uBit.thermometer);
}
2016-06-14 15:30:07 +02:00
}