LightBlue Explorer offers lots of features to help you test Bluetooth Low Energy devices. When LightBlue Explorer connects to a Bean, it offers a view that allows you to set the RGB LED. You can also read data from the accelerometer, analog pins, and digital pins.
This sketch shows how the LightBlue iOS application Bean demo screen can be used. When you connect to a Bean using LightBlue, it will open up the demo screen which probes the Bean for acceleration data, digital pin input values, analog input values, as well as sets the LED.
Software
- LightBlue
- Bean Loader
Hardware
- LightBlue Bean
- Windows or OS X computer
Open the iOS Bean Loader and create a new sketch. Paste the sketch shown below to the screen. Upload and compile the sketch. When you do this a list of Beans should show up. Tap on the Bean you want to program. Afterwards, close the app, and open the LightBlue iOS App.
Use the Bean to send data to LightBlueOpen the LightBlue app and choose the Bean you programmed from the Bean Loader.
When you run LightBlue Explorer and connect to a Bean, your app asks Bean for its information by sending the byte `0x02`.
Bean receives `0x02` and interprets it as a request for information from your iOS device. Bean responds with six bytes total:
Byte 1: 0x82 – Response to 0x02 (decimal value ‘2’ in hexadecimal)
Byte 2:the digital pin values, grouped together into one byte
Byte 3: the low byte of analog pin 1
Byte 4:the high byte of analog pin 1
Byte 5 the low byte of analog pin 2
Byte 6: the high byte of analog pin 2
LightBlue Explorer parses the response and visualizes the received data on your screen.
TroubleshootingHaving trouble with this guide? Reach out to BeanTalk to get directed feedback from our developers and community!
Comments
Please log in or sign up to comment.