Skip to main content

2. Create a new project

Now, you're ready to code.

  1. Click the Explore icon on the left bar. Then click the MadMachine extension on the bottom to show three buttons. Click New Project.
Create a new project.
  1. Choose the project as an executable.
Choose project type.
  1. Choose the board you are going to use.
Choose the board.
  1. Name the project. You could choose any descriptive name you like for the project. Then press the Enter key.
Enter project name.
  1. Choose a location to store the project and press Open.
Choose a file location.
  1. The project will open in a new window. Click on the Explorer Sources / Blink / main.swift to open the file. You will always edit the code in the file main.swift for your future projects. Copy and paste the following sample code into the file.
import SwiftIO
import MadBoard

let led = DigitalOut(Id.BLUE)

while true {
led.write(true)
sleep(ms: 1000)

led.write(false)
sleep(ms: 1000)
}
code