Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API ChainableLED mbed nRF51822
Fork of BLENano_RGB_Demo by
Diff: main.cpp
- Revision:
- 2:12ee9ad6d00c
- Parent:
- 1:e7dc9b3590dd
--- a/main.cpp Wed Apr 20 03:44:22 2016 +0000 +++ b/main.cpp Wed Apr 27 09:52:09 2016 +0000 @@ -31,7 +31,9 @@ #define TXRX_BUF_LEN 5 #define LOCAL_NAME "RGB-L" -#define BUTTON_PIN P0_8//D3 +#define BUTTON_PIN P0_11//D0 +#define RGB_CLK_PIN P0_10//D2 +#define RGB_DIO_PIN P0_8//D3 #define DEVICE_ID 0xFF #define LIGHT_PIN P0_5//A3 #define VOL_PIN P0_4//A4 @@ -44,7 +46,7 @@ BLEDevice ble; -ChainableLED leds(P0_11, P0_9, P0_10,1); +ChainableLED leds(RGB_CLK_PIN, RGB_DIO_PIN, 1); AnalogIn light_sen(LIGHT_PIN); AnalogIn vin(VOL_PIN); @@ -213,8 +215,8 @@ rgb_status = 0; leds.setColorRGB(0, 0, 0, 0); - button.mode(PullUp); - button.fall(&button_handle); + button.mode(PullDown); + button.rise(&button_handle); Ticker ticker; ticker.attach_us(m_status_check_handle, 200000);