The purpose of this repository is to serve as an example for writing a SwiftUI IOS app for connecting to an HM-10 over Bluetooth Low Energy

Overview

HM10-and-IOS-Device

The purpose of this repository is to serve as an example for writing a SwiftUI IOS app for connecting to an HM-10 over Bluetooth Low Energy. The example provided also sends the IOS device's location over BLE to the HM-10, when the button is pressed. An example Arduino program is provided that allows the user to receive messages from the IOS device on the HM-10.

Quick Start

To get started, you can simply open the Xcode project, and build like normal. You must run this on a real IOS device (not the simulator), because you need to use the built in bluetooth. You may run into warnings or errors based on project settings, but Xcode should tell you what needs to be resolved.

For using the provided arduino example with the HM-10, connect the HM-10 to the ground and 5V pins. For your TX (on the HM-10), connect to pin 2 on the arduino, and connect the RX pin of the HM-10 to pin 3 of the arduino. In the arduino program, the first message sent to the HM-10 sets the broadcasted name. Replace "ExampleName" with whatever you want the HM-10 to broadcast. Note, this can only be set when the HM-10 is not connected to a central device. For further info, consult the documentation of the HM-10.

If you built the Xcode project correctly, and have your HM-10 powered up, you should see this when you open the app:

drawing

You should see the name of your HM-10 in list of HM-10's in Area. After hitting the connect button, you should be able to send your position by hitting the "Send Position" button at the bottom of the screen.

On the arduino side, make sure to have your serial window open. With the serial window open, you should see something similar to the below image every time you press the send image button.

Further Reading

The BLEManager class defined in the XCode project is derived from the Ray Wenderlich Bluetooth Tutorial.

The LocationFetcher class defined in the XCode project is derived from the Hacking With Swift Tutorial.

Warnings

Some HM-10's have a built in level shifter to allow 5V logic, but the original HM-10's do not. Consult the documentation for your device.

Also, the Iphone is able to send BLE messages at a much faster rate than the HM-10 can recieve, and this may lead to some overflow errors. In my testing, I have found that I can safely send messages at a rate of one message every 75 milliseconds.

You might also like...
Convenient domain specific language for writing programmatic UI built over UIKit and more.

XYKit Swifty and convenient domain specific language for creating programmatic UI in a more declarative way and more than that. Built on top of UIKit

An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and  Watch.

KFSwiftImageLoader KFSwiftImageLoader is an extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memor

An iOS client for connecting to Linux Mint's Warpinator application

warpinator-iOS This is an iOS application for connecting iOS devices (and hopefully, in the future, macOs computers) to the Linux Mint Warpinator file

A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil
A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil

Drops 💧 A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil. Features iOS 10+ Can be used in Sw

A sample application showcasing Vapor 4 connecting to an Oracle database using SwiftOracle package.

vapor-oracle A sample application showcasing Vapor 4 connecting to an Oracle database using SwiftOracle package. In this Vapor application, we create

Forecasts best times for using green electric energy in the UK
Forecasts best times for using green electric energy in the UK

Greencast - 24 Hour Green Energy Forecaster Greencast aims to help UK consumers optimise their use of green energy to minimise carbon dioxide emission

iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.
iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion. You can use this app for learning purpose. You can use this app as a templet of any event related app.

technex-ios iOS app for Technex, IIT(BHU) Varanasi. This project is closed before completion for some reasons. You can use this app for learning purpo

iOS tweak to display toasts for Low Power alerts and charging

Electrode iOS tweak to display toasts for Low Power alerts and charging. Localization Want to help translate Electrode to your language? Sumbit a pull

An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.
An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.

A simple, intuitive audio framework for iOS and OSX. Deprecated EZAudio has recently been deprecated in favor of AudioKit. However, since some people

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.

Bolts Bolts is a collection of low-level libraries designed to make developing mobile apps easier. Bolts was designed by Parse and Facebook for our ow

Bolts is a collection of low-level libraries designed to make developing mobile apps easier.

Bolts in Swift Bolts is a collection of low-level libraries designed to make developing mobile apps easier. Bolts was designed by Parse and Facebook f

Quickly toggle Low Power Mode from the menu bar

cooldown Quickly toggle Low Power Mode from the menu bar In macOS Monterey Apple introduced a new Low Power Mode for Mac. Cooldown is a simple menu ba

A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if you're using CI).
A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if you're using CI).

CornSnapshotTesting A low-maintenance, simple framework for a snapshot testing, which takes into account a snapshot difference factor (must have if yo

iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).
iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).

FinanceReactNative iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android). Data is pulled from Yahoo Finance

Repository with example app for using Bar chart
Repository with example app for using Bar chart

Gráfico de Barras (Exemplo) Repositório com app exemplo para o uso do gráfico de Barras. O gráfico de barras é um gráfico com barras retangulares e co

Basic Stop Watch & Countdown app for iOS devices. Created for learning purpose.
Basic Stop Watch & Countdown app for iOS devices. Created for learning purpose.

stopwatch Basic Stop Watch (included Countdown feature) app for iOS devices. Created for learning purpose. How to use Just download source code and un

Basic calculator app for iOS devices using Swift3. Created for learning purpose.
Basic calculator app for iOS devices using Swift3. Created for learning purpose.

iOS Calculator App Basic calculator app for iOS devices using Swift 4 and Xcode 9. Created for learning purpose. How to use Just download source code

Basic app to show how to login with Facebook, Google, Twitter. Created for learning purpose :) using Xcode 9 and Swift 4.0
Basic app to show how to login with Facebook, Google, Twitter. Created for learning purpose :) using Xcode 9 and Swift 4.0

Social Logins iOS Basic app to show how to login with Facebook, Google, Twitter. Created for learning purpose :) using Xcode 9 and Swift 4.0 Note: Bef

The purpose of this app is to list all of the schools in New Jersey and assign ratings to chosen schools.
The purpose of this app is to list all of the schools in New Jersey and assign ratings to chosen schools.

My First iOS App Introduction This is my first iOS App from my CSSE337 Enterprise Mobile Apps class for college. Here was the objective of the assignm

Owner
Jeremiah Givens
Jeremiah Givens
Inspect the iOS 15 App Activity Data directly on device.

AppActivityViewer About AppActivityViewer helps to inspect the iOS 15 App Activity Data easily on device. Choose App Activity at share sheet after cli

CJ 15 Mar 30, 2022
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

Andrea Mario Lufino 324 Nov 27, 2022
MbientLab 2 Feb 5, 2022
Diabetes: test the FreeStyle Libre glucose sensor as a Bluetooth Low Energy device, even directly from an Apple Watch.

Since the FreeStyle Libre 2 / 3 glucose sensors are Bluetooth Low Energy devices, I am trying to leverage their capabilities to implement something ne

Guido Soranzio 6 Jan 2, 2023
BLE (Bluetooth LE) for U🎁 Bleu is the best in the Bluetooth library.

Bleu Bleu is a Bluetooth library. Bleu is the easiest way to operate CoreBluetooth. Bleu is possible to operate by replacing Bluetooth 's Peripheral a

1amageek 484 Dec 29, 2022
Simple, block-based, lightweight library over CoreBluetooth. Will clean up your Core Bluetooth related code.

LGBluetooth Simple, block-based, lightweight library over CoreBluetooth. Steps to start using Drag and Drop it into your project Import "LGBluetooth.h

null 170 Sep 19, 2022
An iOS picker view to serve all your "picking" needs

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

Blue Apron 883 Nov 28, 2022
An iOS picker view to serve all your "picking" needs

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

Blue Apron 883 Nov 28, 2022
A small Swift tool/server to serve DocC archives to your browser

servedocc Small Swift script to serve "DocC" archives, a format to document Swift frameworks and packages: Documenting a Swift Framework or Package. N

DocZ 8 Jan 29, 2022
11t is an iOS and Android app for connecting to Mastodon, written in Flutter.

README 11t is an iOS and Android app for connecting to Mastodon, written in Flutter. I connect to Mastodon on mastodon.social, but everyone can start

Jeroen Smeets 88 Dec 23, 2022