![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
First try
Dependencies: BLE_API BLE_Driver I2C_Driver MAX30100 millis mbed nRF51822
Fork of BLE_Driver_Example by
mainbletest.cpp
- Committer:
- Ferszt
- Date:
- 2016-08-22
- Revision:
- 0:882170680817
- Child:
- 1:33d65d13c46a
File content as of revision 0:882170680817:
#include "mbed.h" #include "BLE_Driver.h" DigitalOut LIVE_LED(LED1, 1); DigitalOut CONECT_LED(LED2, 1); DigitalOut TEST_LED(LED3, 1); DigitalIn TEST_BUTTON(p17,PullUp); void callbackBLE(int event) { switch (event){ case 1: CONECT_LED = 0; break; case 2: CONECT_LED = 1; break; default: break; } } void periodicCallback(void){ LIVE_LED =! LIVE_LED; uint8_t a; a= getBLE(); if (a=='G') TEST_LED = !TEST_LED; } int main(void){ Ticker Flasher; Flasher.attach(periodicCallback, 1); iniBLE("Sigfried"); while(1){ if (TEST_BUTTON == 0) putBLE("Hola\n\r"); } }