Read and followed Build an embedded application for a microcontroller at swift.org.