# Trouble sending data from Arduino to iPhone

**URL:** <https://forums.kodeco.com/t/trouble-sending-data-from-arduino-to-iphone/22996>\
**Category:** Swift\
**Created:** [November 22, 2016, 10:01pm UTC](https://forums.kodeco.com/t/trouble-sending-data-from-arduino-to-iphone/22996 "2016-11-22T22:01:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt425x](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/matt425x/32/47643_2.png) [@matt425x](https://forums.kodeco.com/u/matt425x)\
**Post date:** [November 22, 2016, 10:01pm UTC](https://forums.kodeco.com/t/trouble-sending-data-from-arduino-to-iphone/22996/1 "2016-11-22T22:01:30Z")

</div>

I have the BlackWidow BLE board that I bought from back-40 and was wondering just how exactly I can have data sent from the Arduino to the iPhone. I am a beginner to Swift and so far All i know is that from the arduino side you use `BLE_Shield.write("Data");` to send your input. I am unsure how to receive that input from Swift and do something with it.

I would appreciate any help! Thanks in advance!

---

<div class="post-metadata">

**Author:** ![aeberbach](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aeberbach/32/81494_2.png) [@aeberbach](https://forums.kodeco.com/u/aeberbach)\
**Post date:** [November 22, 2016, 11:58pm UTC](https://forums.kodeco.com/t/trouble-sending-data-from-arduino-to-iphone/22996/2 "2016-11-22T23:58:25Z")

</div>

This is actually pretty easy - you just need to look into Core Bluetooth.

[Here’s a tutorial](https://www.raywenderlich.com/85900/arduino-tutorial-integrating-bluetooth-le-ios-swift) to get you started! Specifically using the BlackWidow board, and Swift!

---

<div class="post-metadata">

**Author:** ![matt425x](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/matt425x/32/47643_2.png) [@matt425x](https://forums.kodeco.com/u/matt425x)\
**Post date:** [November 24, 2016, 2:19pm UTC](https://forums.kodeco.com/t/trouble-sending-data-from-arduino-to-iphone/22996/3 "2016-11-24T14:19:30Z")

</div>

Update:

I am using BLE\_Shield.write(“X”); (Arduino) to send the letter “X” and I am using this function and it looks like it somewhat works:

```
 func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?){
        let it = NSString(data: characteristic.value!, encoding: String.Encoding.utf8.rawValue)
        print(it)
    }

```

The problem now is that for some reason it is it does not display the characters correctly. Here is a couple of the prints: ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/5/c/5c4ed268554789f8cb66328a1c4d419a03133cfb.png)

What would be causing this?
