This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Set GPIO over Button click

I`m a newbie at Bluetooth Low Energy and Nordic Chips. I bought a DK for the nRF51822. I would like to set I/O pins over android and iOS application. 1.So what application is the best to start with? 2.Or is there already an app which light up a led or something with a button click? 3.What code I need to load on the nRF51822? 4.If I need to write my own Service, how should i do that in function with setting GPIO?

  • there is a good example code just for that with iOS on this blog site http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html

    The Blinky_be example on this blog allows you to control all 30 i/o pin. The iOS App configure the pin direction (IN or OUT). The iOS App can turn On or Off each i/o pin are all 30 at once. It make use of 2 characteristics. One for configuration, the other for data.

    Other examples showing control of LED matrix multi-display where you can type a text on iOS and send it to the Matrix displays. This examples make use of long characteristic write where you can send more than 20 bytes of data.

    A UART examples with long write. UART data in/out using one characteristic. iOS App serving as dump terminal.

    All examples are updated with SDK6 and SD7 and all projects were created from scratch using Eclipse IDE based project.

  • What you're looking for is the software development kit for the NRF51 - see this question:

    devzone.nordicsemi.com/.../

    The SDK contains many example programs including GPIO, button, and LED related ones.

    See: <nrf51-sdk> / nrf51822 / Board / nrf6310 /, which includes, for example, blinky_example

  • Hi

    A good place to get started with nRF51 and BLE development is reading this blog

    Update 12.11.2014 The blog pointed to above contains reference to the ble_app_lbs example (led button example) which is perhaps the most simple BLE example existing for nRF51822:

    • Write to a characteristic on a central device and a led lids up on the nRF51822 development kit
    • When you press a button on the dev kit, characteristic value is changed on the central device.

    The following example is an add on to that functionality, where you have additional two characteristics, where the example has two leds and two buttons.

    • Press the second button and a value is passed to the central device that contains four bytes
    • Write to the second characteristic from a central device and a led is blinked on the dev kit

    nrf51-ble-app-lbs-master_with_extra_led_and_button.zip

    Note: The example is implemented for nRF51 SDK v5.2.0 and softdevice S110 v6.0.0.

    To connect to the above example from a central side, you can use Master Control Panel for Windows, LightBlue app for IOS or Android (available on App Store and Google Play), or nRF Master Control Panel for Android. Below is also an Android Studio project for Android SDK 18, dedicated for the ble_app_lbs example

    Android LedButtonDemo app.zip

  • With success i tested the LedButtonDemo. I need exactly an application like this but with 2 Buttons which one set 2 LEDs. Did you try this application? Thanks for your answer

Related