Is it possible to use swift and of together?

And i want to use iPhone control arduino via wifi.
which is more easy to use?


there is a bit of a process involved but its doable. You really shouldn’t need swift at all to do what you are asking though

You could use Swift, however it would be a great amount of work as Swift doesn’t have any interoperability with C++ (oF) and you would need to write a C or Objective-C++ layer to isolate the two. If your goal is to communicate with an Arduino via Wi-Fi, I’d imagine there might be easier ways than Swift and oF.

These discussions might be worth a quick read:

Thank you.
Because I have not wrote code for iOS before.
so i do not know how to just use OF to write a app for iOS.
But there are a lots of books for me to learn with swift.
And another reason is there are some bugs in the example for Of for iOS…

I am wondering if it makes sense to modify firmata in a way that i can send it via ethernet, wifi or bluetooth?
Any disadvantages?

In this case, I’d say use Swift or oF, as using both would be more work and would mix at least 3 languages together.

What is your goal, to communicate with an Arduino from an iOS device? How is the Arduino connected, BLE, Wi-Fi directly, ethernet to shared Wi-Fi?

that’s great if i can do so


There is a firmata variant already, check out the github and specifically configurable firmata. I think there is even an example of how to use the ethernet shield or ethernet board

Thanks a lot. I will give it a try.

I read it.But it seems for arduino.
But what to do with iPhone?

This is not so hard, if your arduino needs to wireless as well you can use a wifly to get wifi on your arduino and this library lets you use OSC

And here is a sheild

Just by modifying the OSC example for OF you can get the communication going pretty fast.

However you can choose a lighter library and just use this library

Onyx Ashanti has a great tutorial (there was one error I found PM me if you go down this route and I can dig out the code) for setting up a wifly with arduino

Of course you can also do these things with an ethernet shield or arduino ethernet and the process is the same. There are a few implementations of OSC for arduino but here is one that works well and has clear instructions

OSC makes a simple structure for messaging, but you can also use plain UDP, there are examples for OF in the download and also with the arduino ethernet library