Introduction to DIY Midi Controllers Part 2

Hello World!

So, you bought an Arduino and bunch of components and are now probably wondering what have I gotten myself into. No worries, just remember the guide and Don’t Panic!

Our first step is to test out the little Arduino and see if it works, so let’s dive right in and create our first program.

First you will need to download and install the Arduino software. We need it to write and communicate programs to our Arduino.

Download: https://www.arduino.cc/en/Main/software

Once the software has installed, connect the Arduino to your computer using the USB cable.

From the top menu choose tools and select the type of board you are using. I’m using a Leonardo.

Go to the tools menu again and select the port your Arduino is connected to. Your port number may be different to mine.


In Arduino speak a “sketch” is the name of an Arduino program. Let’s make our first sketch (program) and upload it to our Arduino.

Copy and paste the code below and overwrite the code in the current sketch that is open. Then go file/save to store the sketch (program) to your computer first.

// the setup function runs once when you press reset or power the board
void setup() {
    pinMode(LED_BUILTIN, OUTPUT); // initialize LED_BUILTIN as an output.
}

// the loop function runs continuously.
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(100);                       // wait for a second
}

There are two parts to Arduino code. The first part (void setup) sets everything up and the second part (void loop) will run all the time, looping continuously. Any notes can be added to the sketch using //


The code we just entered is going to tell the Arduino to turn on its built in LED and flash repeatedly.

Let’s verify that our code is OK and then upload it to the Arduino.

Click the tick icon to verify the code.

Then click the upload arrow.


If all went well you should now have a flashing Arduino.
Try altering the delay times in the code and uploading the sketch to the Arduino again.

Congratulations on your first program, but don’t break out the champagne just yet, it’s not a midi controller without some twisty bits.