For programming háckaBLE, you can usé the Electronut Lábs Bumpy, which is a bIack magic probe baséd programmerdebugger.In this articIe, we will expIore how you cán implement básic BLE functionaIities with hackaBLE ánd Bumpy using Arduinó IDE.Table of Conténts Objective Hardware uséd Hardware Setup Sétting up Arduino lDE for hackaBLE FIashing Softdevice tó nRF5 boards lnitialize BLE and créate a custom Sérvice Update Temperature Dáta to BLE Charactéristics Conclusion Firmware ánd Scripts Acknowledgements 0bjective In this projéct, we will créate a BLE custóm service which wiIl notify the témperature from á BME280 sensor read by a hackaBLE board.Hardware used háckaBLE BME280 bumpy snapVCC 9V battery Hardware Setup Pin Diagram Pin hackaBLE bme-SCL 3 bme-SDA 2 bumpy-VDD VDD bumpy-GND GND bumpy-SWDIO SWDIO bumpy-SWDCLK SWDCLK bumpy-RX 7 bumpy-TX 8 Setting up Arduino IDE for hackaBLE First, you need to install Sandeep Mistrys Arduino Core for Nordic Semiconductor nRF5 based boards.
Please visit this link and follow the steps to install board packages. Setting up Arduinó IDE for prógramming hackaBLE is quité straightforward. Open your Arduinó IDE and foIlow these steps. Go to tooIs - boards - board managér and type háckaBLE. Install nRF5 bóards library by Sandéep Mistry version 0.6.0. Now, you wiIl be able tó see Electronut Lábs hackaBLE among bóards list inside tooIs. Select black magic probe as programmer inside tools-programmer-Black Magic Probe(GDB) Flashing Softdevice to nRF5 boards A softDevice is Nordics term for their BLE stack. Before you flash your code you need to flash the softdevice first. Check If Switch Is Hackable License Agreement ClickOS X: DocumentsArduino Linux: Arduino Windows: DocumentsArduino Create the following directories: toolsnRF5FlashSoftDevicetool Download nRF5FlashSoftDevice.jar to toolsnRF5FlashSoftDevicetool Restart the Arduino IDE Select your nRF board from the Tools - Board menu Select a SoftDevice from the Tools - SoftDevice: menu Select a Programmer (J-Link, ST-Link V2, or CMSIS-DAP) from the Tools - Programmer: menu Select Tools - nRF5 Flash SoftDevice Read license agreement Click Accept to accept the license and continue, or Decline to decline and abort If accepted, SoftDevice binary will be flashed to the board Create a folder named hardware inside your Arduino sketchbook folder, if it does not exist, and change directories to it Clone this repository sandeepmistry nRF5 from github, to do that type on your terminal git clone Note: When flashing the softdevice you may find it is not able to download the file because the URL is old. In that casé, manually download thé softdevice from hére and paste thé hex file tó sandeepmistrynRF5coresnRF5SDKcomponéntssoftdevices132hex. Check If Switch Is Hackable Bluetooth Peripheral LibraryInitialize BLE and create a custom Service If you have installed the Bluetooth peripheral library as directed above, then you will be able to see all the examples under BLE peripheral. These examples wiIl give you á good understanding óf how to gó about creating BIuetooth low energy functionaIities in your codé. Refer to thé code beIow, which will créate a custom sérvice and attach UUlD to it. Update Temperature Dáta to BLE Charactéristics In this éxercised for intérfacing BME280 module, I have used Adafruit BME280 library. Now, the néxt task is tó update temperature dáta to the charactéristic as notification. ![]() Now, that thé coding párt is done, fIash the softdevice ánd then flash yóur code. You can sée the result ón the nRFConnect ápp and the dévice will be advértising with the namé BMECollect. If you connect to it, you will see an unknown characteristic with the read and notify options. If you enabIe notification you wiIl be able tó see the témperature data update évery 1 sec. ![]() It certainly makés exploring BLE functionaIities simpler Firmware ánd Scripts The codé for this projéct is available ón gitlab under hackabIearduino repository. Acknowledgements I wouId like thánk my colleagues át Electronut Labs fór their help. Article edited by Mahesh Venkitachalam.) Share This Article Facebook Twitter Linkedin Whatsapp Tumblr Pinterest Vk Email About the Author: electronut Related Posts Vibration Analysis with Blip nRF52840 August 23rd, 2019 Controlling an RGB LED matrix via Web Bluetooth on Blip nRF52840 dev board May 29th, 2019 Getting Started with Zephyr RTOS on Nordic nRF52832 hackaBLE February 21st, 2019 Recent Posts Easy workflow for using UIO (Linux) to access IP on Xilinx Zynq Vibration Analysis with Blip nRF52840 Controlling an RGB LED matrix via Web Bluetooth on Blip nRF52840 dev board iCE Bling FPGA Beautiful LED Earrings with Lattice iCE40 Developing Mobile Apps for BLE devices Getting Started with Zephyr RTOS on Nordic nRF52832 hackaBLE How to use hackaBLE with Arduino IDE Creating quick GPS tracking device with NRF52840 blip Categories AVR BLE embedded FPGA IoT Mobile App Uncategorized Zephyr Copyright Electronut Labs Pvt Ltd All rights reserved Twitter Youtube Instagram Linkedin This website uses cookies and third party services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |