Using BLE to control multiple LEDs

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
Posts: 1
Joined: Wed Nov 01, 2017 12:34 pm

Using BLE to control multiple LEDs

Post by mflavoni » Wed Nov 01, 2017 12:38 pm

Hi everyone,

I am pretty new to BLE (and coding for that matter), and was looking at the project in the link below. ... energy-ble

I was able to get this working, but I was curious how the code would need to change if I wanted to control more than one LED. My first instinct would be to send different values for each LED to the arduino and use if statements to distinguish which LED I was looking to change, but I didn't know if you were able to send values other than 0 or 1 to the board. If someone could explain how I can go about doing this, that would be great.


Support Volunteer
Posts: 1743
Joined: Wed Dec 22, 2010 2:05 am

Re: Using BLE to control multiple LEDs

Post by Valen » Mon Nov 06, 2017 12:33 pm

This image of Experiment 21 suggests that the value that is sent is a byte (argument).
So yeah, that would mean it can count further than 1. What sort of other value types are available in the bluetooth/smartphone app is something you'll have to investigate in the documentation mentioned. The CurieBLE link suggests on that page that the maximum size of "a characteristic value can be up to 20 bytes long". So plenty of space if you can concatenate and decode your data in a systematic way.

Post Reply