Issue with Data Overflow in Hairless while using Arduino Nano

Hello,

(a complete noob at coding here).

I am trying to build an 8 button USB Foot controller with Arduino Nano. I know, I know this is not the best chip for making USB Midi based projects but this is all I have at this point.

So I was checking online and I stumbled upon a person who has done something like this successfully with the Nano. Also using Loop MIDI and Hairless.

Youtube link: https://youtu.be/TdUmoSTvW14?list=WL

I made the box that I needed for the foot pedal and tried to use the same code but something is wrong. Earlier it was fine but now the board is continuously sending MIDI data to Hairless MIDI don’t know why.

I tried using example 02 of

library but then there came a problem of Bounce (i suspect). I cannot seem to get both to work together.

If anyone can find time to go through the attachment (the code I used)/help me in combining the example 02 with taking care of the bounce issue it would be a world of help!

This is my code at present:

#include <MIDI_Controller.h> // Include the library

const uint8_t velocity = 0b1111111; // Maximum velocity (0b1111111 = 0x7F = 127)

Digital buttons[] = {
    {2, 0x10, 1, velocity}, 
    {3, 0x11, 1, velocity},
    {4, 0x12, 1, velocity},
    {5, 0x13, 1, velocity},
};

void setup() {
  Serial.begin(115200);
  }

void loop() {
  MIDI_Controller.refresh();
}

MIDI_Controller.ino (19.3 KB)