Swift for Arduino
New game from Space-It Industries ltd.
Welcome to Swift for Arduino (TM)!
​
A world first! The Swift for Arduino IDE allows you to write simple programs using a light-weight version of Swift, suitable for microcontrollers. There is a class library that allows standard functions. The compiler is built from the open source swift compiler and an experimental build of the open source LLVM project.
The IDE has smarts to try to search for potential issues, plus fully integrated build and upload and much more.
See a demonstration of creating
an "SOS" flasher from scratch.
​
Our Facebook page is : here, see some fun demos and get involved in the community.
Our Twitter page is: here
Get involved in the community and see more sample code here: Community
See a video of the launch talk from 10th August 2017 at Code Node, Skills Matter:Video : Slides
At this time the product only supports Arduino UNO.
See help for more info.
Want to get started already? You can jump to the payment page, find out more details and buy Swift for Arduino...
News
The S4A team is growing and working tirelessly on bugs and new releases.
We now have created a community in Slack! Email us if you want to join our channels.
We presented Swift for Arduino on Thursday 10th of August, at Swift London meetup at SkillsMatter|CodeNode
​
Here's the slides from that night.
You can view the talk about Swift for Arduino and see a lot of other cool stuff here...
FAQs
Q: how do I get the software?
A: email us on swiftforarduino@gmail.com and we will send you a link and a password
Q: What is it?
​
A: This is the world's first compiler for the Swift language onto the Arduino UNO. The Arduino is a popular IoT platform but due to it's compressed characteristics, many high level languages cannot function simply. The compiler uses LLVM magic to build a .hex suitable for uploading onto an Arduino UNO. You can see more details here
​
Q: What is the file format?
​
A: The editor is mostly a simple text editor for a swift file. When you save a new document using the editor or open an existing document, a .swift4a file is used. The actual document is a bundle, a folder, containing the core .swift file and various related files. Firstly there is a .h file and a .c file, automagically used by the IDE for string constants in progmem. Then after a successful build you will see a .ll file, a .elf.s file and a .hex file. The .hex is the finished program that is uploaded to the board using avrdude. The .ll and .elf.s are intermediate files that can be used for debugging issues. They're the LLVM IR and full asm of the finished ELF. If you don't know what these are you can safely ignore them. If you have issues with your program, you can send the full bundle to us, including your source code and these intermediates, together with an explanation of symptoms and we'll have a look: swiftforarduino@gmail.com.
Q: Which boards are supported?
​
A: Arduino UNO. The build system builds a .hex file compatible with the AVR Atmega328p microcontroller. If you plug an Arduino UNO into a USB port on your mac, the IDE should recognise the board and allow you to upload. The IDE automatically figures out what serial device the Arduino presents and configures avrdude to upload using that interface. It will also recognize the ICSP made by Arduino and automatically upload using that if present. Most other ICSPs are not yet recognized.
Q: Can I get this working with board XX or processor YY?
A: I've had a few questions like this, which is very nice to hear as it shows people are interested! As usual with a hobby project like this, I'm doing it in my own time with my own kit so it's limited what I can write support for. If you know what you're doing and you have an Atmega328p (or very, very similar) processor based board, you could try getting the finished .hex from the bundle and uploading manually. YMMV. Let us know how you get on and if there would be an easier place to dump the .hex files from a build and we can try!
For other microcontrollers, it would take more work to get the build system to output a suitable .hex. I'm willing to do it if enough people want it. Though it may be tricky for me to test without hardware.
Q: Does this rely on the "standard" Arduino IDE (the one from their website)?
A: No. This is a completely new project. It relies on AVR GCC/binutils/libc, which is an older and more low level set of open source projects, used as the basis for many products such as WinAVR. Also it relies on Swift, currently using the swiftc from Xcode, which must be installed. And lastly on a custom built variant of llvm. The llvm, gcc, binutils executables and binaries should all be included in the .app package but the build relies on swiftc being present from Xcode separately.